Class Rubinius::Actor
In: lib/rubinius/actor.rb
lib/rubinius/actor/filter.rb
Parent: Object

actor/filter.rb - actor message filters

Copyright 2007-2008 MenTaLguY <mental@rydia.net>

          2007-2011  Evan Phoenix <evan@fallingsnow.net>

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, thi slist of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentatio and/or other materials provided with the distribution.
  • Neither the name of the Evan Phoenix nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Methods

Classes and Modules

Module Rubinius::Actor::ANY
Class Rubinius::Actor::DeadActorError
Class Rubinius::Actor::Filter

Constants

ANY = Object.new

External Aliases

new -> private_new
spawn -> new
trap_exit -> trap_exit?
lookup -> []
register -> []=

Public Class methods

Polls for exit notifications

Link the current Actor to another one.

Lookup a locally named service

Waits until a matching message is received in the current actor‘s mailbox, and executes the appropriate action. May be interrupted by exit notifications.

Register an Actor locally as a named service

Send a "fake" exit notification to another actor, as if the current actor had exited with reason

Spawn a new Actor that will run in its own thread

Atomically spawn an actor and link it to the current actor

Is the Actor trapping exit?

Actors trapping exit do not die when an error occurs in an Actor they are linked to. Instead the exit message is sent to their regular mailbox in the form [:exit, actor, reason]. This allows certain Actors to supervise sets of others and restart them in the event of an error. Setting the trap flag may be interrupted by pending exit notifications.

Unlink the current Actor from another one

Public Instance methods

<<(message)

Alias for send

Notify this actor that one of the Actors it‘s linked to has exited; this is not intended to be used directly except by actor implementations. Most users will want to use Actor.send_exit instead.

Notify this actor that it‘s now linked to the given one; this is not intended to be used directly except by actor implementations. Most users will want to use Actor.link instead.

Notify this actor that it‘s now unlinked from the given one; this is not intended to be used directly except by actor implementations. Most users will want to use Actor.unlink instead.

[Validate]