Skip to content

Instantly share code, notes, and snippets.

@akgupta
Created January 31, 2020 23:42
Show Gist options
  • Save akgupta/dbcb99e1780606c36fb4160ace045ff9 to your computer and use it in GitHub Desktop.
Save akgupta/dbcb99e1780606c36fb4160ace045ff9 to your computer and use it in GitHub Desktop.
getContext().watch(_eventSourceActor);
@Override
public Receive createReceive() {
return receiveBuilder()
.match(
Terminated.class,
terminated -> {
if (terminated.getActor().equals(_eventSourceActor)) {
getContext().stop(self());
}
}
)
.build();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment