use of im.actor.runtime.actors.ask.AskIntRequest in project actor-platform by actorapp.
the class AskcableActor method onReceive.
@Override
public void onReceive(Object message) {
if (message instanceof AskIntRequest) {
AskIntRequest askRequest = (AskIntRequest) message;
try {
Promise p = onAsk(askRequest.getMessage());
if (p == null) {
// Just ignore. We assume that message is stashed
return;
}
p.pipeTo(askRequest.getFuture());
} catch (Exception e) {
e.printStackTrace();
askRequest.getFuture().tryError(e);
}
} else {
super.onReceive(message);
}
}
Aggregations