Class: RactorPool::Reducer

Inherits:
Object
  • Object
show all
Defined in:
lib/ractor_pool/reducer.rb

Direct Known Subclasses

RactorPool::Reducers::CollectReducer

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(logger:) ⇒ Reducer

Returns a new instance of Reducer.



6
7
8
9
# File 'lib/ractor_pool/reducer.rb', line 6

def initialize(logger:)
  @logger = logger
  @result = initial_value
end

Instance Attribute Details

#loggerObject (readonly)

Returns the value of attribute logger.



4
5
6
# File 'lib/ractor_pool/reducer.rb', line 4

def logger
  @logger
end

#resultObject (readonly)

Returns the value of attribute result.



4
5
6
# File 'lib/ractor_pool/reducer.rb', line 4

def result
  @result
end

Instance Method Details

#initial_valueObject

Raises:

  • (NotImplementedError)


11
12
13
# File 'lib/ractor_pool/reducer.rb', line 11

def initial_value
  raise NotImplementedError
end