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

Inherits:
Context show all
Includes:
AsAdHoc
Defined in:
lib/concurrent-ruby-edge/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 Method Summary collapse

Instance Method Details

#initialize(*args, &initializer) ⇒ undocumented Originally defined in module AsAdHoc

#on_message(message) ⇒ undocumented Originally defined in module AsAdHoc