Class: Plumbing::Pipeline::Base
- Includes:
- Actor
- Defined in:
- lib/plumbing/pipeline/base.rb
Overview
Abstract base for all pipelines. A pipeline is an actor, so its observer list and event queue are safe under the concurrent workers. Observers are procs, each called with every emitted event.
Constant Summary
Constants included from Actor
Actor::FIBER_KEY, Actor::NotSupported
Instance Attribute Summary
Attributes included from Actor
Instance Method Summary collapse
-
#<<(event) ⇒ Object
Emit an event (alias for #push).
-
#initialize ⇒ Base
constructor
A new instance of Base.
Methods included from Actor
#after, #cancel_deferred, #current_sender, #current_senders, included
Methods included from Actor::Configuration
#register, #selected_worker_type, #uses, #worker_for, #worker_types, #workers
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
14 15 16 17 18 19 20 |
# File 'lib/plumbing/pipeline/base.rb', line 14 def initialize super @observers = [] @queue = [] @seen = Set.new @draining = false end |
Instance Method Details
#<<(event) ⇒ Object
Emit an event (alias for #push). Returns the awaitable message.
71 |
# File 'lib/plumbing/pipeline/base.rb', line 71 def <<(event) = push(event: event) |