Scala Library
|
|
scala/actors/Actor.scala
]
trait
Actor
extends
AbstractActor with
ReplyReactor with
scala.actors.ReplyableActorThis class provides an implementation of event-based actors. The main ideas of our approach are explained in the two papers
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 |
Method Details |
protected[this] override
def
makeReaction(fun : () => Unit) : java.lang.Runnable
protected[this] override
def
resumeReceiver(item : (Any, OutputChannel[Any]), onSameThread : Boolean) : Unit
def
receive[R](f : PartialFunction[Any, R]) : R
f -
a partial function with message patterns and actions
def
receiveWithin[R](msec : Long)(f : PartialFunction[Any, R]) : R
msec -
the time span before timeoutf -
a partial function with message patterns and actionsoverride
def
react(f : PartialFunction[Any, Unit]) : Nothing
This method never returns. Therefore, the rest of the computation has to be contained in the actions of the partial function.
f -
a partial function with message patterns and actions
def
reactWithin(msec : Long)(f : PartialFunction[Any, Unit]) : Nothing
This method never returns. Therefore, the rest of the computation has to be contained in the actions of the partial function.
msec -
the time span before timeoutf -
a partial function with message patterns and actions
def
? : Any
protected override
def
scheduleActor(f : PartialFunction[Any, Unit], msg : Any) : Unit
override
def
start : Actor
def
link(to : AbstractActor) : AbstractActor
self
to actor to
.to -
the actor to link toself
to the actor defined by body
.body -
the body of the actor to link to
def
unlink(from : AbstractActor) : Unit
self
from actor from
.
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
'normal
.
Scala Library
|
|