Copyright 2008 - 2009 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg

This software is released under an open source BSD licence.

fj.control.parallel
Class QueueActor<A>

java.lang.Object
  extended by fj.control.parallel.QueueActor<A>

public final class QueueActor<A>
extends Object

An Actor equipped with a queue. Messages are acted on in some (but any) order. This actor is guaranteed to act on only one message at a time, but the order in which they are acted upon is undefined. Author: Runar


Method Summary
 void act(A a)
          Submit a message to this actor's queue.
 Actor<A> asActor()
          Provides an Actor representation of this QueueActor
static
<A> QueueActor<A>
queueActor(Strategy<Unit> s, Effect<A> e)
          Constructs an actor, equipped with a queue, that uses the given strategy and has the given effect.
static
<A> QueueActor<A>
queueActor(Strategy<Unit> s, F<A,P1<Unit>> e)
          Constructs an actor, equipped with a queue, that uses the given strategy and has the given effect.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

queueActor

public static <A> QueueActor<A> queueActor(Strategy<Unit> s,
                                           Effect<A> e)
Constructs an actor, equipped with a queue, that uses the given strategy and has the given effect.

Parameters:
s - The strategy to use to manage this actor's queue.
e - What this actor does with its messages.
Returns:
A new actor, equipped with a queue so that it processes one message at a time.

queueActor

public static <A> QueueActor<A> queueActor(Strategy<Unit> s,
                                           F<A,P1<Unit>> e)
Constructs an actor, equipped with a queue, that uses the given strategy and has the given effect.

Parameters:
s - The strategy to use to manage this actor's queue.
e - What this actor does with its messages.
Returns:
A new actor, equipped with a queue so that it processes one message at a time.

asActor

public Actor<A> asActor()
Provides an Actor representation of this QueueActor

Returns:
An Actor that represents this QueueActor

act

public void act(A a)
Submit a message to this actor's queue.

Parameters:
a - A message to submit to this actor's queue.

Copyright 2008 - 2009 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg

This software is released under an open source BSD licence.