Package groovy.concurrent
Interface ReactorHandler<T,R>
- Type Parameters:
T- the message typeR- the reply type
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Context-aware handler for reactor actors. Receives the actor context
and the incoming message; returns the reply value bound to
Actor.sendAndGet(T) callers.
To stop the actor from inside the handler, call
ctx.self().stop().
- Since:
- 6.0.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionapply(ActorContext<T> ctx, T message) Processes a single message and returns the reply.
-
Method Details
-
apply
Processes a single message and returns the reply.- Parameters:
ctx- the actor contextmessage- the incoming message- Returns:
- the reply value
-