module Celluloid::ClassMethods
Class methods added to classes which include Celluloid
Public Instance Methods
===(other)
click to toggle source
# File lib/celluloid.rb, line 242 def ===(other) other.is_a? self end
actor_options()
click to toggle source
Configuration options for Actor#new
# File lib/celluloid.rb, line 222 def actor_options { actor_system: actor_system, mailbox_class: mailbox_class, mailbox_size: mailbox_size, task_class: task_class, exclusive: exclusive_actor, } end
actor_system()
click to toggle source
# File lib/celluloid.rb, line 217 def actor_system Celluloid.actor_system end
behavior_options()
click to toggle source
# File lib/celluloid.rb, line 232 def behavior_options { proxy_class: proxy_class, exclusive_methods: exclusive_methods, exit_handler_name: exit_handler_name, finalizer: finalizer, receiver_block_executions: execute_block_on_receiver, } end
new(*args, &block)
click to toggle source
# File lib/celluloid.rb, line 194 def new(*args, &block) proxy = Cell.new(allocate, behavior_options, actor_options).proxy proxy._send_(:initialize, *args, &block) proxy end
Also aliased as: spawn
new_link(*args, &block)
click to toggle source
Create a new actor and link to the current one
# File lib/celluloid.rb, line 202 def new_link(*args, &block) fail NotActorError, "can't link outside actor context" unless Celluloid.actor? proxy = Cell.new(allocate, behavior_options, actor_options).proxy Actor.link(proxy) proxy._send_(:initialize, *args, &block) proxy end
Also aliased as: spawn_link
run(*args, &block)
click to toggle source
Run an actor in the foreground
# File lib/celluloid.rb, line 213 def run(*args, &block) Actor.join(new(*args, &block)) end