scala.actors

trait Actor

[source: scala/actors/Actor.scala]

@serializable

trait Actor
extends AbstractActor with ReplyReactor with scala.actors.ReplyableActor

This class provides an implementation of event-based actors. The main ideas of our approach are explained in the two papers

Author
Philipp Haller
Direct Known Subclasses:
DaemonActor

Value Summary
var trapExit : Boolean
Values and Variables inherited from ReplyReactor
senders
Values and Variables inherited from Reactor
mailbox, sendBuffer, continuation, waitingForNone, waitingFor
Method Summary
def ? : Any
Receives the next message from this actor's mailbox.
protected[actors] override def exit : Nothing
Terminates with exit reason 'normal.
protected[actors] def exit (reason : AnyRef) : Nothing
def link (to : AbstractActor) : AbstractActor
Links self to actor to.
def link (body : => Unit) : Actor
Links self to the actor defined by body.
protected[this] override def makeReaction (fun : () => Unit) : java.lang.Runnable
override def react (f : PartialFunction[Any, Unit]) : Nothing
Receives a message from this actor's mailbox.
def reactWithin (msec : Long)(f : PartialFunction[Any, Unit]) : Nothing
Receives a message from this actor's mailbox within a certain time span.
def receive [R](f : PartialFunction[Any, R]) : R
Receives a message from this actor's mailbox.
def receiveWithin [R](msec : Long)(f : PartialFunction[Any, R]) : R
Receives a message from this actor's mailbox within a certain time span.
protected[this] override def resumeReceiver (item : (Any, OutputChannel[Any]), onSameThread : Boolean) : Unit
protected override def scheduleActor (f : PartialFunction[Any, Unit], msg : Any) : Unit
override def start : Actor
Starts this actor.
def unlink (from : AbstractActor) : Unit
Unlinks self from actor from.
Methods inherited from scala.actors.ReplyableActor
scala.actors.ReplyableActor.!?, scala.actors.ReplyableActor.!?, scala.actors.ReplyableActor.!!, scala.actors.ReplyableActor.!!
Methods inherited from ReplyReactor
sender, reply, !, forward
Methods inherited from Reactor
act (abstract), exceptionHandler, scheduler, mailboxSize, send, receiver, drainSendBuffer, searchMailbox, terminated
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Value Details
var trapExit : Boolean

Method Details
protected[this] override def makeReaction(fun : () => Unit) : java.lang.Runnable

protected[this] override def resumeReceiver(item : (Any, OutputChannel[Any]), onSameThread : Boolean) : Unit
Overrides
ReplyReactor.resumeReceiver

def receive[R](f : PartialFunction[Any, R]) : R
Receives a message from this actor's mailbox.
Parameters
f - a partial function with message patterns and actions
Returns
result of processing the received value

def receiveWithin[R](msec : Long)(f : PartialFunction[Any, R]) : R
Receives a message from this actor's mailbox within a certain time span.
Parameters
msec - the time span before timeout
f - a partial function with message patterns and actions
Returns
result of processing the received value

override def react(f : PartialFunction[Any, Unit]) : Nothing
Receives a message from this actor's mailbox.

This method never returns. Therefore, the rest of the computation has to be contained in the actions of the partial function.

Parameters
f - a partial function with message patterns and actions

def reactWithin(msec : Long)(f : PartialFunction[Any, Unit]) : Nothing
Receives a message from this actor's mailbox within a certain time span.

This method never returns. Therefore, the rest of the computation has to be contained in the actions of the partial function.

Parameters
msec - the time span before timeout
f - a partial function with message patterns and actions

def ? : Any
Receives the next message from this actor's mailbox.

protected override def scheduleActor(f : PartialFunction[Any, Unit], msg : Any) : Unit

override def start : Actor
Starts this actor.

def link(to : AbstractActor) : AbstractActor
Links self to actor to.
Parameters
to - the actor to link to
Returns
the parameter actor

def link(body : => Unit) : Actor
Links self to the actor defined by body.
Parameters
body - the body of the actor to link to
Returns
the parameter actor

def unlink(from : AbstractActor) : Unit
Unlinks self from actor from.

protected[actors] def exit(reason : AnyRef) : Nothing

Terminates execution of self with the following effect on linked actors:

For each linked actor a with trapExit set to true, send message Exit(self, reason) to a.

For each linked actor a with trapExit set to false (default), call a.exit(reason) if reason != 'normal.


protected[actors] override def exit : Nothing
Terminates with exit reason 'normal.