|
Scala 2.3.0
|
object
Actor
extends
java.lang.Object
with
scala.ScalaObject
Actor
object provides functions for the definition of
actors, as well as all actor operations, such as
receive
, react
, reply
,
etc.Class Summary | |
class
FromReceive
|
|
private
|
class
RecursiveProxyHandler
|
Trait Summary | |
abstract
|
trait
Body
[a]
|
Constructor Summary | |
def
this
|
Val Summary | |
val
selfs
: java.util.WeakHashMap
|
Def Summary | |
def
?
: scala.Any
|
|
def
actor
(body: => scala.Unit)
: scala.actors.Actor
|
|
def
choose
[a, b >: a]
(alt1: => a, alt2: => b)
: b
|
|
def
eventloop
(f: scala.PartialFunction[scala.Any, scala.Unit])
: scala.Nothing
|
|
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
[a]
(body: => a)
: java.lang.Object with Actor.this.Body[a]
|
|
def
poll
: scala.Option[scala.Any]
|
|
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
[a, b >: a]
(first: => a, next: => b)
: b
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
[a]
extends
java.lang.Object
with
scala.ScalaObject
Def Summary | |
abstract
|
def
andThen
[b >: a]
(other: => b)
: b
|
abstract
|
def
orElse
[b >: a]
(other: => b)
: b
|
Def Detail |
Constructor Detail |
Val Detail |
Def Detail |
def
?
: scala.Any
def
actor
(body: => scala.Unit): scala.actors.Actor
def
eventloop
(f: scala.PartialFunction[scala.Any, scala.Unit]): scala.Nothing
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
[a](body: => a): java.lang.Object with Actor.this.Body[a]
def
poll
: scala.Option[scala.Any]
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
self
to execute first
followed by next
.first -
...
next -
...
def
unlink
(from: scala.actors.Actor): scala.Unit
self
from actor from
.from -
...