private Task<Boolean> checkAlive(final String handle, final SimpleStreamProxy subscriber) { final ActorRuntime runtime = ActorRuntime.getRuntime(); final NodeAddress r = await(runtime.locateActor((Addressable) subscriber, false)); if (r == null) { state().subscribers.remove(handle); return Task.fromValue(Boolean.FALSE); } return Task.fromValue(Boolean.TRUE); }
/** * Requests the deactivation of an actor * * @param actor the actor which you want to deactivate. * @return A task indicating the state of the request. Immediately resolved if actor is not activated. */ static Task deactivate(final Actor actor) { final NodeAddress address = await(ActorRuntime.getRuntime().locateActor(RemoteReference.from(actor), false)); if(address != null) { final RuntimeActions runtimeActions = DefaultDescriptorFactory.observerRef(address, RuntimeActions.class, ""); return runtimeActions.deactivateActor(actor); } return Task.done(); }
if (!Objects.equals(runtime.getLocalAddress(), await(runtime.locateActor(reference, true))))
/** * Requests the deactivation of an actor * * @param actor the actor which you want to deactivate. * @return A task indicating the state of the request. Immediately resolved if actor is not activated. */ static Task deactivate(final Actor actor) { final NodeAddress address = await(ActorRuntime.getRuntime().locateActor(RemoteReference.from(actor), false)); if(address != null) { final RuntimeActions runtimeActions = DefaultDescriptorFactory.observerRef(address, RuntimeActions.class, ""); return runtimeActions.deactivateActor(actor); } return Task.done(); }