scala.actors

trait Reactor

[source: scala/actors/Reactor.scala]

trait Reactor
extends OutputChannel[Any] with AnyRef
The Reactor trait provides lightweight actors.
Author
Philipp Haller
Direct Known Subclasses:
ReplyReactor

Value Summary
protected var continuation : PartialFunction[Any, Unit]
protected val mailbox : MessageQueue
protected var sendBuffer : Queue[(Any, OutputChannel[Any])]
protected var waitingFor : (Any) => Boolean
protected val waitingForNone : (Any) => Boolean
Method Summary
def ! (msg : Any) : Unit
Sends msg to this OutputChannel (asynchronous).
abstract def act : Unit
The behavior of an actor is specified by implementing this abstract method.
protected[this] def drainSendBuffer (mbox : MessageQueue) : Unit
protected[actors] def exceptionHandler : PartialFunction[java.lang.Exception, Unit]
protected[actors] def exit : Nothing
def forward (msg : Any) : Unit
Forwards msg to this OutputChannel (asynchronous).
protected[actors] def mailboxSize : Int
protected[this] def makeReaction (fun : () => Unit) : java.lang.Runnable
protected[actors] def react (f : PartialFunction[Any, Unit]) : Nothing
def receiver : Actor
Returns the Reactor that is receiving from this OutputChannel.
protected[this] def resumeReceiver (item : (Any, OutputChannel[Any]), onSameThread : Boolean) : Unit
protected def scheduleActor (f : PartialFunction[Any, Unit], msg : Any) : Unit
protected[actors] def scheduler : IScheduler
protected[this] def searchMailbox (startMbox : MessageQueue, handlesMessage : (Any) => Boolean, resumeOnSameThread : Boolean) : Unit
def send (msg : Any, replyTo : OutputChannel[Any]) : Unit
Sends msg to this actor (asynchronous) supplying explicit reply destination.
def start : Reactor
protected[actors] def terminated : Unit
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Value Details
protected val mailbox : MessageQueue

protected var sendBuffer : Queue[(Any, OutputChannel[Any])]

protected var continuation : PartialFunction[Any, Unit]

protected val waitingForNone : (Any) => Boolean

protected var waitingFor : (Any) => Boolean

Method Details
abstract def act : Unit
The behavior of an actor is specified by implementing this abstract method.

protected[actors] def exceptionHandler : PartialFunction[java.lang.Exception, Unit]

protected[actors] def scheduler : IScheduler

protected[actors] def mailboxSize : Int

def send(msg : Any, replyTo : OutputChannel[Any]) : Unit
Sends msg to this actor (asynchronous) supplying explicit reply destination.
Parameters
msg - the message to send
replyTo - the reply destination
Overrides
OutputChannel.send

protected[this] def makeReaction(fun : () => Unit) : java.lang.Runnable

protected[this] def resumeReceiver(item : (Any, OutputChannel[Any]), onSameThread : Boolean) : Unit

def !(msg : Any) : Unit
Sends msg to this OutputChannel (asynchronous).
Overrides
OutputChannel.!

def forward(msg : Any) : Unit
Forwards msg to this OutputChannel (asynchronous).
Overrides
OutputChannel.forward

def receiver : Actor
Returns the Reactor that is receiving from this OutputChannel.
Overrides
OutputChannel.receiver

protected[this] def drainSendBuffer(mbox : MessageQueue) : Unit

protected[this] def searchMailbox(startMbox : MessageQueue, handlesMessage : (Any) => Boolean, resumeOnSameThread : Boolean) : Unit

protected[actors] def react(f : PartialFunction[Any, Unit]) : Nothing

protected def scheduleActor(f : PartialFunction[Any, Unit], msg : Any) : Unit

def start : Reactor

protected[actors] def exit : Nothing

protected[actors] def terminated : Unit