Class: Kreuzberg::Config::Concurrency

Inherits:
Object
  • Object
show all
Defined in:
lib/kreuzberg/config.rb

Overview

Concurrency configuration for thread pool management

Examples:

Limit max threads

concurrency = Concurrency.new(max_threads: 4)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(max_threads: nil) ⇒ Concurrency

Returns a new instance of Concurrency.



931
932
933
# File 'lib/kreuzberg/config.rb', line 931

def initialize(max_threads: nil)
  @max_threads = max_threads&.to_i
end

Instance Attribute Details

#max_threadsObject (readonly)

Returns the value of attribute max_threads.



929
930
931
# File 'lib/kreuzberg/config.rb', line 929

def max_threads
  @max_threads
end

Instance Method Details

#to_hObject



935
936
937
938
939
# File 'lib/kreuzberg/config.rb', line 935

def to_h
  h = {}
  h[:max_threads] = @max_threads unless @max_threads.nil?
  h
end