scala.actors

trait InputChannel

[source: scala/actors/InputChannel.scala]

trait InputChannel[+Msg]
extends AnyRef
The InputChannel trait provides a common interface for all channels from which values can be received.
Version
0.9.8
Author
Philipp Haller
Direct Known Subclasses:
Channel

Method Summary
abstract def ? : Msg
Receives the next message from this Channel.
abstract def react (f : PartialFunction[Msg, Unit]) : Nothing
Receives a message from this InputChannel.

This method never returns. Therefore, the rest of the computation has to be contained in the actions of the partial function.

abstract def reactWithin (msec : Long)(f : PartialFunction[Any, Unit]) : Nothing
Receives a message from this InputChannel 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.

abstract def receive [R](f : PartialFunction[Msg, R]) : R
Receives a message from this InputChannel.
abstract def receiveWithin [R](msec : Long)(f : PartialFunction[Any, R]) : R
Receives a message from this InputChannel within a certain time span.
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
abstract def receive[R](f : PartialFunction[Msg, R]) : R
Receives a message from this InputChannel.
Parameters
f - a partial function with message patterns and actions
Returns
result of processing the received value

abstract def receiveWithin[R](msec : Long)(f : PartialFunction[Any, R]) : R
Receives a message from this InputChannel within a certain time span.
Parameters
msec - the time span before timeout
f - a partial function with message patterns and actions
Returns
result of processing the received value

abstract def react(f : PartialFunction[Msg, Unit]) : Nothing
Receives a message from this InputChannel.

This method never returns. Therefore, the rest of the computation has to be contained in the actions of the partial function.

Parameters
f - a partial function with message patterns and actions

abstract def reactWithin(msec : Long)(f : PartialFunction[Any, Unit]) : Nothing
Receives a message from this InputChannel 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.

Parameters
msec - the time span before timeout
f - a partial function with message patterns and actions

abstract def ? : Msg
Receives the next message from this Channel.