Class: Aws::Crt::IO::EventLoopGroupOptions

Inherits:
Object
  • Object
show all
Includes:
ManagedNative
Defined in:
lib/aws-crt/io/event_loop_group.rb

Overview

Options for an EventLoopGroup

Instance Method Summary collapse

Methods included from ManagedNative

included, #manage_native, #native, #native_set?, #release

Constructor Details

#initialize(max_threads = nil) ⇒ EventLoopGroupOptions

Returns a new instance of EventLoopGroupOptions.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/aws-crt/io/event_loop_group.rb', line 14

def initialize(max_threads = nil)
  unless max_threads.nil? ||
         (max_threads.is_a?(Integer) && max_threads.positive?)
    raise ArgumentError, 'max_threads must be nil or positive Integer'
  end

  # Ruby uses nil to request default values, native code uses 0
  max_threads = 0 if max_threads.nil?

  manage_native do
    Aws::Crt::Native.event_loop_group_options_new
  end

  Aws::Crt::Native.event_loop_group_options_set_max_threads(@native,
                                                            max_threads)
end