module Concurrent::ActorContext
def self.included(base)
def self.included(base) class << base # Create a single, unregistered actor. The actor will run on its own, dedicated # thread. The thread will be started the first time a message is post to the actor. # Should the thread ever die it will be restarted the next time a message is post. # # @param [Hash] opts the options defining actor behavior # @option opts [Array] :args (`nil`) arguments to be passed to the actor constructor # # @return [SimpleActorRef] the `ActorRef` encapsulating the actor def spawn(opts = {}) args = opts.fetch(:args, []) Concurrent::SimpleActorRef.new(self.new(*args), opts) end end end