class Celluloid::Proxy::Actor
A proxy which controls the Actor lifecycle
def alive?
def alive? @mailbox.alive? end
def dead?
def dead? !alive? end
def initialize(mailbox, thread)
def initialize(mailbox, thread) @mailbox = mailbox @thread = thread end
def inspect
def inspect # TODO: use a system event to fetch actor state: tasks? "#<Celluloid::Proxy::Actor(#{@mailbox.address}) alive>" rescue DeadActorError "#<Celluloid::Proxy::Actor(#{@mailbox.address}) dead>" end
def terminate
def terminate terminate! ::Celluloid::Actor.join(self) nil end
def terminate!
def terminate! ::Kernel.raise ::Celluloid::DeadActorError, "actor already terminated" unless alive? @mailbox << ::Celluloid::TerminationRequest.new end