Scala Library
|
|
scala/actors/Channel.scala
]
class
Channel[Msg]
extends
InputChannel[Msg] with
OutputChannel[Msg] with
AnyRefChannel
may receive from it.Additional Constructor Summary | |
def
|
this (recv : Actor) : Channel[Msg] |
Method Summary | |
def
|
!
(msg : Msg) : Unit
Sends a message to this
Channel . |
def
|
!?
(msg : Msg) : Any
Sends a message to this
Channel and
awaits reply. |
def
|
!?
(msec : Long, msg : Msg) : Option[Any]
Sends a message to this
Channel and
awaits reply within a certain time span. |
def
|
?
: Msg
Receives the next message from this
Channel . |
def
|
forward
(msg : Msg) : Unit
Forwards
msg to this keeping the
last sender as sender instead of self . |
def
|
react
(f : PartialFunction[Msg, Unit]) : Nothing
Receives a message from this
Channel . |
def
|
reactWithin
(msec : Long)(f : PartialFunction[Any, Unit]) : Nothing
Receives a message from this
Channel within a certain
time span. |
def
|
receive
[R](f : PartialFunction[Msg, R]) : R
Receives a message from this
Channel . |
def
|
receiveWithin
[R](msec : Long)(f : PartialFunction[Any, R]) : R
Receives a message from this
Channel within a certain
time span. |
def
|
receiver
: Actor
Returns the
Actor that is
receiving from this OutputChannel . |
def
|
send
(msg : Msg, replyTo : OutputChannel[Any]) : Unit
Sends a message to this
Channel
(asynchronous) supplying explicit reply destination. |
Methods inherited from AnyRef | |
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Additional Constructor Details |
Method Details |
def
receiver : Actor
Actor
that is
receiving from this OutputChannel
.Channel
.msg -
the message to be sent
def
send(msg : Msg, replyTo : OutputChannel[Any]) : Unit
Channel
(asynchronous) supplying explicit reply destination.msg -
the message to sendreplyTo -
the reply destinationmsg
to this
keeping the
last sender as sender instead of self
.
def
receive[R](f : PartialFunction[Msg, R]) : R
Channel
.f -
a partial function with message patterns and actions
def
? : Msg
Channel
.
def
receiveWithin[R](msec : Long)(f : PartialFunction[Any, R]) : R
Channel
within a certain
time span.msec -
the time span before timeoutf -
a partial function with message patterns and actions
def
react(f : PartialFunction[Msg, Unit]) : Nothing
Channel
.
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
Channel
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.
msec -
the time span before timeoutf -
a partial function with message patterns and actionsChannel
and
awaits reply.msg -
the message to be sentChannel
and
awaits reply within a certain time span.msec -
the time span before timeoutmsg -
the message to be sentNone
in case of timeout, otherwise Some(x)
where x
is the reply
Scala Library
|
|