public final class Actor<A>
extends java.lang.Object
queueActor(fj.control.parallel.Strategy<fj.Unit>, fj.function.Effect1<T>)
static method.Modifier and Type | Method and Description |
---|---|
P1<Unit> |
act(A a)
Pass a message to this actor, applying its side-effect to the message.
|
static <A> Actor<A> |
actor(Strategy<Unit> s,
Effect1<A> e)
Creates a new Actor that uses the given parallelization strategy and has the given side-effect.
|
static <A> Actor<A> |
actor(Strategy<Unit> s,
F<A,P1<Unit>> e)
Creates a new Actor that uses the given parallelization strategy and has the given side-effect.
|
<B> Actor<B> |
contramap(F<B,A> f)
Contravariant functor pattern.
|
Actor<Promise<A>> |
promise()
Transforms this actor to an actor on promises.
|
static <T> Actor<T> |
queueActor(Strategy<Unit> s,
Effect1<T> ea)
An Actor equipped with a queue and which is guaranteed to process one message at a time.
|
public static <T> Actor<T> queueActor(Strategy<Unit> s, Effect1<T> ea)
public static <A> Actor<A> actor(Strategy<Unit> s, Effect1<A> e)
s
- The parallelization strategy to use for the new Actor.e
- The side-effect to apply to messages passed to the Actor.public static <A> Actor<A> actor(Strategy<Unit> s, F<A,P1<Unit>> e)
s
- The parallelization strategy to use for the new Actor.e
- The function projection of a side-effect to apply to messages passed to the Actor.public P1<Unit> act(A a)
a
- The message to send to this actor.public <B> Actor<B> contramap(F<B,A> f)
f
- The function to use for the transformation