scala.actors

trait Actor

[source: scala/actors/Actor.scala]

@serializable

@SerialVersionUID(-781154067877019505L)

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:
SwingWorker, DaemonActor

Value Summary
var trapExit : Boolean
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 (body : => Unit) : Actor
Links self to the actor defined by body.
def link (to : AbstractActor) : AbstractActor
Links self to actor to.
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[actors] override def scheduler : IScheduler
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, mailboxSize, send, receiver
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[actors] override def scheduler : IScheduler

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.

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.