Scala Library Documentation
|
|
scala/actors/Actor.scala
]
object
Actor
extends
AnyRefActor
object provides functions for the definition of
actors, as well as all actor operations, such as
receive
, react
, reply
,
etc.Value Summary | |
val
|
tl : ThreadLocal |
Method Summary | |
def
|
?
: Any
Receives the next message from the mailbox of the current actor
self . |
def
|
actor
(body : => Unit) : Actor
This function is used for the definition of actors. The following example demonstrates its usage: import scala.actors.Actor._ ... val a = actor { ... } |
def
|
continue : Unit |
def
|
eventloop (f : PartialFunction[Any, Unit]) : Nothing |
def
|
exit
: Nothing
Terminates execution of
For each linked actor |
def
|
exit
(reason : AnyRef) : Nothing
Terminates execution of
For each linked actor
For each linked actor |
def
|
link
(to : Actor) : Actor
Links
self to actor to . |
def
|
link
(body : => Unit) : Actor
Links
self to actor defined by body . |
def
|
loop
(body : => Unit) : Nothing
Causes
self to repeatedly execute
body . |
implicit def
|
mkBody [a](body : => a) : Body[a] |
def
|
react
(f : PartialFunction[Any, Unit]) : Nothing
Lightweight variant of
receive .
Actions in f have to contain the rest of the
computation of self , as this method will never
return. |
def
|
reactWithin
(msec : Long)(f : PartialFunction[Any, Unit]) : Nothing
Lightweight variant of
receiveWithin .
Actions in f have to contain the rest of the
computation of self , as this method will never
return. |
def
|
receive
[A](f : PartialFunction[Any, A]) : A
Receives a message from the mailbox of
self . Blocks if no message matching any of the
cases of f can be received. |
def
|
receiveWithin
[R](msec : Long)(f : PartialFunction[Any, R]) : R
Receives a message from the mailbox of
self . Blocks at most msec
milliseconds if no message matching any of the cases of
f can be received. If no message could be
received the TIMEOUT action is executed if
specified. |
def
|
reply
: Unit
Send
() to the actor waiting in a call to
!? . |
def
|
reply
(msg : Any) : Unit
Send
msg to the actor waiting in a call to
!? . |
def
|
resetProxy
: Unit
Resets an actor proxy associated with the current thread.
It replaces the implicit
ActorProxy instance
of the current thread (if any) with a new instance.
This permits to re-use the current thread as an actor
even if its ActorProxy has died for some reason. |
def
|
self
: Actor
Returns the currently executing actor. Should be used instead
of
this in all blocks of code executed by
actors. |
def
|
sender
: OutputChannel[Any]
Returns the actor which sent the last received message.
|
def
|
unlink
(from : Actor) : Unit
Unlinks
self from actor from . |
Methods inherited from AnyRef | |
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Class Summary | |
trait
|
Body
[a] extends AnyRef
|
Scala Library Documentation
|
|