package pf
Type Members
-
class
DeciderBuilder
extends AnyRef
Used for building a partial function for
Actor.supervisorStrategy()
.Used for building a partial function for
Actor.supervisorStrategy()
. * Inside an actor you can use it like this with Java 8 to define your supervisorStrategy.Example:
@Override private static SupervisorStrategy strategy = new OneForOneStrategy(10, Duration.create("1 minute"), DeciderBuilder. match(ArithmeticException.class, e -> resume()). match(NullPointerException.class, e -> restart()). match(IllegalArgumentException.class, e -> stop()). matchAny(o -> escalate()).build()); @Override public SupervisorStrategy supervisorStrategy() { return strategy; }
This is an EXPERIMENTAL feature and is subject to change until it has received more real world testing.
-
final
class
FI
extends AnyRef
Class that encapsulates all the Functional Interfaces used for creating partial functions.
Class that encapsulates all the Functional Interfaces used for creating partial functions.
This is an EXPERIMENTAL feature and is subject to change until it has received more real world testing.
-
class
FSMStateFunctionBuilder
[S, D] extends AnyRef
Builder used to create a partial function for
akka.actor.FSM#whenUnhandled
. -
class
FSMStopBuilder
[S, D] extends AnyRef
Builder used to create a partial function for
akka.actor.FSM#onTermination
. -
class
FSMTransitionHandlerBuilder
[S] extends AnyRef
Builder used to create a partial function for
akka.actor.FSM#onTransition
. -
class
Match
[I, R] extends AbstractMatch[I, R]
Version of
scala.PartialFunction
that can be built during runtime from Java. -
final
class
PFBuilder
[I, R] extends AbstractPFBuilder[I, R]
A builder for
scala.PartialFunction
. -
class
ReceiveBuilder
extends AnyRef
Used for building a partial function for
Actor.receive()
.Used for building a partial function for
Actor.receive()
.There is both a match on type only, and a match on type and predicate.
Inside an actor you can use it like this with Java 8 to define your receive method.
Example:
@Override public Actor() { receive(ReceiveBuilder. match(Double.class, d -> { sender().tell(d.isNaN() ? 0 : d, self()); }). match(Integer.class, i -> { sender().tell(i * 10, self()); }). match(String.class, s -> s.startsWith("foo"), s -> { sender().tell(s.toUpperCase(), self()); }).build() ); }
This is an EXPERIMENTAL feature and is subject to change until it has received more real world testing.
-
class
UnitMatch
[I] extends AbstractMatch[I, BoxedUnit]
Version of
scala.PartialFunction
that can be built during runtime from Java.Version of
scala.PartialFunction
that can be built during runtime from Java. This is a specialized version ofUnitMatch
to map java void methods toscala.runtime.BoxedUnit
. -
final
class
UnitPFBuilder
[I] extends AbstractPFBuilder[I, BoxedUnit]
A builder for
scala.PartialFunction
.A builder for
scala.PartialFunction
. This is a specialized version ofPFBuilder
to map java void methods toscala.runtime.BoxedUnit
.