Class: Concurrent::Actress::Root

Inherits:
Object
  • Object
show all
Includes:
Context
Defined in:
lib/concurrent/actress.rb

Overview

implements ROOT

Instance Attribute Summary

Attributes included from Context

#core

Instance Method Summary collapse

Methods included from Context

#children, #logger, #on_envelope, #spawn, #terminate!

Methods included from CoreDelegations

#executor, #name, #parent, #path, #reference, #terminated, #terminated?

Methods included from TypeCheck

#Child!, #Child?, #Match!, #Match?, #Type!, #Type?

Instance Method Details

#on_message(message) ⇒ Object

to allow spawning of new actors, spawn needs to be called inside the parent Actor



30
31
32
33
34
35
36
# File 'lib/concurrent/actress.rb', line 30

def on_message(message)
  if message.is_a?(Array) && message.first == :spawn
    spawn message[1], &message[2]
  else
    # ignore
  end
end