Class: Conrad::ProcessorStack Private
- Inherits:
-
Object
- Object
- Conrad::ProcessorStack
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/conrad/processor_stack.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Contains the main logic to share how processors are handled between the individual, one-off recorder and the collector.
Instance Attribute Summary collapse
-
#processors ⇒ Object
readonly
private
The processors used by this Stack.
Instance Method Summary collapse
-
#call(event) ⇒ nil, Hash
private
Processes an event through the defined set of operations, returning the final hash.
-
#initialize(processors) ⇒ ProcessorStack
constructor
private
A new instance of ProcessorStack.
Constructor Details
#initialize(processors) ⇒ ProcessorStack
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ProcessorStack.
20 21 22 23 24 |
# File 'lib/conrad/processor_stack.rb', line 20 def initialize(processors) check_callability(processors) @processors = processors end |
Instance Attribute Details
#processors ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The processors used by this Stack
12 13 14 |
# File 'lib/conrad/processor_stack.rb', line 12 def processors @processors end |
Instance Method Details
#call(event) ⇒ nil, Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Processes an event through the defined set of operations, returning the final hash. It is possible to ‘throw :halt_conrad_processing` to stop the processing stack. There should be no additional arguments to the `throw` call. At this point, the processing will stop and return nil.
34 35 36 37 38 39 40 |
# File 'lib/conrad/processor_stack.rb', line 34 def call(event) catch :halt_conrad_processing do processors.reduce(event) do |previous_built_event, processor| processor.call(previous_built_event) end end end |