java - How do I monitor all Terminated messages in akka? -
i want create actor subscribes terminated messages actors created in system. how do that?
i have tried below - not seem work,
getcontext().system().eventstream().subscribe(getself(), terminated.class);
and avoid below - because need each actor want monitor.,
getcontext().watch(subject);
a similar (but bit less hacky) way solve implement publish/subscribe pattern (as described here in scala instance)
then have actor subscribe specific event (such "terminated") that:
eventstream.subscribe(foo.onevent, "terminated")
Comments
Post a Comment