class Concurrent::Actor::Behaviour::Abstract
Attributes
core[R]
subsequent[R]
Public Class Methods
new(core, subsequent, core_options)
click to toggle source
# File lib/concurrent-ruby-edge/concurrent/actor/behaviour/abstract.rb, line 14 def initialize(core, subsequent, core_options) @core = Type! core, Core @subsequent = Type! subsequent, Abstract, NilClass end
Public Instance Methods
broadcast(public, event)
click to toggle source
broadcasts event to all behaviours and context @see on_event
@see AbstractContext#on_event
# File lib/concurrent-ruby-edge/concurrent/actor/behaviour/abstract.rb, line 39 def broadcast(public, event) core.broadcast(public, event) end
on_envelope(envelope)
click to toggle source
override to add extra behaviour @note super needs to be called not to break the chain
# File lib/concurrent-ruby-edge/concurrent/actor/behaviour/abstract.rb, line 21 def on_envelope(envelope) pass envelope end
on_event(public, event)
click to toggle source
override to add extra behaviour @note super needs to be called not to break the chain
# File lib/concurrent-ruby-edge/concurrent/actor/behaviour/abstract.rb, line 32 def on_event(public, event) subsequent.on_event public, event if subsequent end
pass(envelope)
click to toggle source
@param [Envelope] envelope to pass to {#subsequent} behaviour
# File lib/concurrent-ruby-edge/concurrent/actor/behaviour/abstract.rb, line 26 def pass(envelope) subsequent.on_envelope envelope end
reject_envelope(envelope)
click to toggle source
# File lib/concurrent-ruby-edge/concurrent/actor/behaviour/abstract.rb, line 43 def reject_envelope(envelope) envelope.reject! ActorTerminated.new(reference) dead_letter_routing << envelope unless envelope.future log(DEBUG) { "rejected #{envelope.message} from #{envelope.sender_path}"} end