Class: Concurrent::Actor::Utils::AdHoc

Inherits:
Context show all
Includes:
AsAdHoc
Defined in:
lib/concurrent/actor/utils/ad_hoc.rb

Overview

Allows quick creation of actors with behaviour defined by blocks.

Examples:

ping

AdHoc.spawn :forward, an_actor do |where|
  # this block has to return proc defining #on_message behaviour
  -> message { where.tell message  }
end

Instance Attribute Summary

Attributes inherited from AbstractContext

#core

Method Summary

Methods included from AsAdHoc

#initialize, #on_message

Methods inherited from Context

#behaviour_definition

Methods inherited from AbstractContext

#ask, #behaviour_definition, #dead_letter_routing, #default_executor, #default_reference_class, #envelope, #on_envelope, #on_event, #on_message, #pass, spawn, spawn!, #tell

Methods included from InternalDelegations

#behaviour, #behaviour!, #children, #context, #dead_letter_routing, #log, #redirect, #terminate!, #terminated?

Methods included from PublicDelegations

#context_class, #executor, #name, #parent, #path, #reference

Methods included from TypeCheck

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