Last active
December 11, 2015 22:58
-
-
Save p14n/4673436 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RemoteErrorActor extends UntypedActor { | |
@SuppressWarnings("rawtypes") | |
@Override | |
public void onReceive(Object o) throws Exception { | |
if (o instanceof RemoteClientWriteFailed) { | |
RemoteClientWriteFailed fail = (RemoteClientWriteFailed) o; | |
if (fail.getRequest() instanceof Tuple3) { | |
Tuple3 t3 = (Tuple3) fail.getRequest(); | |
if (t3._2() instanceof Some) { | |
Some s = (Some) t3._2(); | |
if (s.get() instanceof PromiseActorRef) { | |
PromiseActorRef par = (PromiseActorRef) s.get(); | |
par.tell(/*something useful*/, self()); | |
} | |
} | |
} | |
} | |
} | |
} | |
system.eventStream().subscribe(system.actorOf(new Props(RemoteErrorActor.class)), | |
RemoteClientWriteFailed.class); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment