@FunctionalInterface
public interface ReactorHandler<T, R>
Context-aware handler for reactor actors. Receives the actor context and the incoming message; returns the reply value bound to Actor.sendAndGet callers.
To stop the actor from inside the handler, call
ctx.self().stop().
T - the message typeR - the reply type| Type Params | Return Type | Name and description |
|---|---|---|
|
public R |
apply(ActorContext<T> ctx, T message)Processes a single message and returns the reply. |
Processes a single message and returns the reply.
ctx - the actor contextmessage - the incoming message