Class: Concurrent::Actor::Behaviour::Awaits

Inherits:
Abstract
  • Object
show all
Defined in:
lib/concurrent/actor/behaviour/awaits.rb

Overview

Accepts :await messages. Which allows to wait on Actor to process all previously send messages.

actor << :a << :b
actor.ask(:await).wait # blocks until :a and :b are processed

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

This class inherits a constructor from Concurrent::Actor::Behaviour::Abstract

Instance Attribute Details

- (undocumented) core (readonly) Originally defined in class Abstract

- (undocumented) subsequent (readonly) Originally defined in class Abstract

Instance Method Details

- (undocumented) on_envelope(envelope)



11
12
13
14
15
16
17
# File 'lib/concurrent/actor/behaviour/awaits.rb', line 11

def on_envelope(envelope)
  if envelope.message == :await
    true
  else
    pass envelope
  end
end