|
Scala 2.2.0
|
object
Actor
extends
java.lang.Object with
scala.ScalaObjectActor
object provides functions for the definition of
actors, as well as all actor operations, such as
receive
, react
, reply
,
etc.Class Summary | |
class
FromReceive
|
Trait Summary | |
abstract
|
trait
Body
[T]
|
Constructor Summary | |
def
this
|
Val Summary | |
val
selfs
: java.util.WeakHashMap
|
Def Summary | |
def
actor
(body: => scala.Unit)
: scala.actors.Actor
|
|
def
choose
(alt1: => scala.Unit, alt2: => scala.Unit)
: scala.Unit
|
|
def
exit
(reason: java.lang.String)
: scala.Unit
Terminates execution of
For each linked actor
For each linked actor |
|
def
from
(r: scala.actors.Actor)
: Actor.this.FromReceive
Used for receiving a message from a specific actor. Example: from (a) receive { //... }
|
|
def
link
(body: => scala.Unit)
: scala.actors.Actor
Links self to actor defined by body .
|
|
def
link
(to: scala.actors.Actor)
: scala.actors.Actor
Links self to actor to .
|
|
def
loop
(body: => scala.Unit)
: scala.Unit
Causes self to repeatedly execute
body .
|
|
def
mkBody
(body: => scala.Unit)
: java.lang.Object with Actor.this.Body[scala.Unit]
|
|
def
react
(f: scala.PartialFunction[scala.Any,scala.Unit])
: scala.Nothing
receive for event-based reactors.
Actions in f have to contain the rest of the
computation of self , as this method will never
return.
|
|
def
reactWithin
(msec: scala.Long)(f: scala.PartialFunction[scala.Any,scala.Unit])
: scala.Nothing
receiveWithin for event-based reactors.
Actions in f have to contain the rest of the
computation of self , as this method will never
return.
|
|
def
receive
[a]
(f: scala.PartialFunction[scala.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: scala.Long)(f: scala.PartialFunction[scala.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
: scala.Unit
Send () to the actor waiting in a call to
!? .
|
|
def
reply
(msg: scala.Any)
: scala.Unit
Send msg to the actor waiting in a call to
!? .
|
|
def
self
: scala.actors.Actor
Returns the currently executing actor. Should be used instead of this in all blocks of code executed by
actors.
|
|
def
sender
: scala.actors.Actor
Returns the actor which sent the last received message. |
|
def
seq
(first: => scala.Unit, next: => scala.Unit)
: scala.Unit
Causes self to execute first
followed by next .
|
|
def
unlink
(from: scala.actors.Actor)
: scala.Unit
Unlinks self from actor from .
|
Trait Detail |
abstract
trait
Body
[T]
extends
java.lang.Object with
scala.ScalaObjectDef Summary | |
abstract
|
def
andThen
(other: => T)
: T
|
abstract
|
def
orElse
(other: => T)
: T
|
Def Detail |
abstract
def
andThen
(other: => T): T
abstract
def
orElse
(other: => T): T
Constructor Detail |
def
this
Val Detail |
val
selfs
: java.util.WeakHashMap
Def Detail |
def
actor
(body: => scala.Unit): scala.actors.Actor
def
choose
(alt1: => scala.Unit, alt2: => scala.Unit): scala.Unit
def
exit
(reason: java.lang.String): scala.Unit
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.equals("normal")
.
def
from
(r: scala.actors.Actor): Actor.this.FromReceive
Used for receiving a message from a specific actor.
Example:
from (a) receive { //... }
r -
...
def
link
(body: => scala.Unit): scala.actors.Actor
self
to actor defined by body
.body -
...
def
link
(to: scala.actors.Actor): scala.actors.Actor
self
to actor to
.to -
...
def
loop
(body: => scala.Unit): scala.Unit
self
to repeatedly execute
body
.body -
...
def
mkBody
(body: => scala.Unit): java.lang.Object with Actor.this.Body[scala.Unit]
def
react
(f: scala.PartialFunction[scala.Any,scala.Unit]): scala.Nothing
receive
for event-based reactors.
Actions in f
have to contain the rest of the
computation of self
, as this method will never
return.f -
...
def
reactWithin
(msec: scala.Long)(f: scala.PartialFunction[scala.Any,scala.Unit]): scala.Nothing
receiveWithin
for event-based reactors.
Actions in f
have to contain the rest of the
computation of self
, as this method will never
return.msec -
...
f -
...
def
receive
[a](f: scala.PartialFunction[scala.Any,a]): a
self
. Blocks if no message matching any of the
cases of f
can be received.f -
...
def
receiveWithin
[R](msec: scala.Long)(f: scala.PartialFunction[scala.Any,R]): R
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.msec -
...
f -
...
def
reply
: scala.Unit
()
to the actor waiting in a call to
!?
.
def
reply
(msg: scala.Any): scala.Unit
msg
to the actor waiting in a call to
!?
.
def
self
: scala.actors.Actor
this
in all blocks of code executed by
actors.
def
sender
: scala.actors.Actor
def
seq
(first: => scala.Unit, next: => scala.Unit): scala.Unit
self
to execute first
followed by next
.first -
...
next -
...
def
unlink
(from: scala.actors.Actor): scala.Unit
self
from actor from
.from -
...