org.codehaus.gpars

groovyx.gpars.actor
Class ReactiveActor

java.lang.Object
  groovyx.gpars.serial.WithSerialId
      groovyx.gpars.actor.impl.MessageStream
          groovyx.gpars.actor.Actor
              groovyx.gpars.actor.AbstractLoopingActor
                  groovyx.gpars.actor.ReactiveActor

class ReactiveActor
extends AbstractLoopingActor

An actor representing a reactor. When it receives a message, the supplied block of code is run with the message as a parameter and the result of the code is send in reply.

 final def doubler = reactor {message ->
     2 * message
 }*
 def result = doubler.sendAndWait(10)
 

Authors:
Vaclav Pech, Alex Tkachman Date: Jun 26, 2009


Field Summary
private static long serialVersionUID

 
Fields inherited from class Actor
ACTOR_HAS_ALREADY_BEEN_STARTED, START_MESSAGE, STOP_MESSAGE, TERMINATE_MESSAGE, TIMEOUT_MESSAGE, currentThread, parallelGroup, timer
 
Constructor Summary
ReactiveActor(groovy.lang.Closure body)

 
Method Summary
 
Methods inherited from class AbstractLoopingActor
getCore, getSender, hasBeenStopped, initialize, isActive, isFair, makeFair, reply, replyIfExists, send, setParallelGroup, setTimeout, silentStart, start, stop, sweepNextMessage, terminate
 
Methods inherited from class Actor
createActorMessage, createRemoteHandle, deregisterCurrentActorWithThread, getJoinLatch, getParallelGroup, handleException, handleInterrupt, handleStart, handleTermination, handleTimeout, hasBeenStopped, isActive, isActorThread, join, join, join, join, onStop, registerCurrentActorWithThread, sendAndContinue, setParallelGroup, silentStart, start, stop, sweepNextMessage, sweepQueue, terminate, threadBoundActor
 
Methods inherited from class MessageStream
call, getRemoteClass, leftShift, reInterrupt, send, send, send, sendAndWait, sendAndWait, sendAndWait
 
Methods inherited from class WithSerialId
createRemoteHandle, getOrCreateSerialHandle, getRemoteClass, writeReplace
 

Field Detail

serialVersionUID

private static final long serialVersionUID


 
Constructor Detail

ReactiveActor

public ReactiveActor(groovy.lang.Closure body)


 

Copyright © 2008–2010 Václav Pech. All Rights Reserved.