private void scheduleTimeoutMessage(ActorContext context, TimeoutMessage message, long delay) { context.system() .scheduler() .scheduleOnce( Duration.create(delay, TimeUnit.MILLISECONDS), context.self(), message, context.dispatcher(), context.self()); }
private void applyRedirectionRule(RedirectionRule body) { context() .system() .scheduler() .scheduleOnce(Duration.create(body.ruleTTL, TimeUnit.MILLISECONDS), self(), new RuleTimeoutMessage(body.getRuleId()), context().dispatcher(), self()); redirectionRules.put(body.getRuleId(), body); }
void scheduleTimeoutMessage(ActorContext context, EndpointEvent event) { context.system() .scheduler() .scheduleOnce(Duration.create(getTtl(event), TimeUnit.MILLISECONDS), context.self(), new EndpointEventTimeoutMessage(event), context.dispatcher(), context.self()); }
/** * Wait and retry. */ public void waitAndRetry() { ContinueToSendToBatchSenderAsstManager continueToSendToBatchSenderAsstManager = new ContinueToSendToBatchSenderAsstManager( processedWorkerCount); logger.debug("NOW WAIT Another " + asstManagerRetryIntervalMillis + " MS. at " + PcDateUtils.getNowDateTimeStrStandard()); getContext() .system() .scheduler() .scheduleOnce( Duration.create(asstManagerRetryIntervalMillis, TimeUnit.MILLISECONDS), getSelf(), continueToSendToBatchSenderAsstManager, getContext().system().dispatcher(), getSelf()); return; }
/** * * 201412: now consider the poller. With poller, will cancel this future * task and reschedule */ private void cancelExistingIfAnyAndScheduleTimeoutCall() { // To handle cases where this operation takes extremely long, schedule a // 'timeout' message to be sent to us if (timeoutMessageCancellable != null && !timeoutMessageCancellable.isCancelled()) { timeoutMessageCancellable.cancel(); } // now reschedule timeoutMessageCancellable = getContext() .system() .scheduler() .scheduleOnce(timeoutDuration, getSelf(), OperationWorkerMsgType.OPERATION_TIMEOUT, getContext().system().dispatcher(), getSelf()); }
.system() .scheduler() .scheduleOnce(timeOutDuration, getSelf(), ExecutionManagerMsgType.OPERATION_TIMEOUT, getContext().system().dispatcher(), getSelf());
.system() .scheduler() .scheduleOnce( timeoutDuration, getSelf(), .system() .scheduler() .scheduleOnce( (FiniteDuration) Duration.create(0.5, TimeUnit.SECONDS), .system() .scheduler() .scheduleOnce( (FiniteDuration) Duration.create( ParallecGlobalConfig.sshFutureCheckIntervalSec,
.system() .scheduler() .scheduleOnce( timeoutDuration, getSelf(), .system() .scheduler() .scheduleOnce( (FiniteDuration) Duration.create(0.5, TimeUnit.SECONDS), .system() .scheduler() .scheduleOnce( (FiniteDuration) Duration.create( ParallecGlobalConfig.pingFutureCheckIntervalSec,
.system() .scheduler() .scheduleOnce( Duration.create(httpPollerProcessor .getPollIntervalMillis(),
.system() .scheduler() .scheduleOnce( timeoutDuration, getSelf(),
.system() .scheduler() .scheduleOnce( timeoutDuration, getSelf(),
.system() .scheduler() .scheduleOnce( timeoutDuration, getSelf(),
public <T extends BackendInfo> Cancellable executeInActor(@Nonnull final InternalCommand<T> command, final FiniteDuration delay) { return scheduler.scheduleOnce(Preconditions.checkNotNull(delay), self(), Preconditions.checkNotNull(command), executionContext, ActorRef.noSender()); } }
private Cancellable scheduleOnce(final FiniteDuration when, final Object message, final ActorRef sender) { return persistenceActor.context() .system() .scheduler() .scheduleOnce(when, persistenceActor.self(), message, persistenceActor.context().dispatcher(), sender); }
private void schedulePendingResponse(final ConnectivityCommandResponse response, final ActorRef sender) { getContext().system().scheduler() .scheduleOnce(flushPendingResponsesTimeout, sender, response, getContext().dispatcher(), getSelf()); }
@Override public void doApply(final Terminated message) { log.info("Persistence actor for Thing with ID <{}> terminated abnormally.", thingId); child = null; final Duration restartDelay = calculateRestartDelay(); getContext().system() .scheduler() .scheduleOnce(new FiniteDuration(restartDelay.toNanos(), TimeUnit.NANOSECONDS), getSelf(), StartChild.INSTANCE, getContext().dispatcher(), null); restartCount += 1; }
private void scheduleSnapshot(final long intervalInSeconds) { // send a message to ourselft: snapshotter = getContext().system().scheduler() .scheduleOnce(Duration.apply(intervalInSeconds, TimeUnit.SECONDS), getSelf(), TakeSnapshotInternal.INSTANCE, getContext().dispatcher(), null); }
private void scheduleShutdown() { shutdownCancellable = getContext().getSystem().scheduler() .scheduleOnce(SHUTDOWN_DELAY, getSelf(), Shutdown.getInstance(), getContext().dispatcher(), ActorRef.noSender()); }
private void stopSelfIfDeletedAfterDelay() { final ExecutionContextExecutor dispatcher = getContext().dispatcher(); cancelStopSelfIfDeletedTrigger(); stopSelfIfDeletedTrigger = getContext().system() .scheduler() .scheduleOnce(DELETED_ACTOR_LIFETIME, getSelf(), STOP_SELF_IF_DELETED, dispatcher, ActorRef.noSender()); }
private void scheduleCheckForPolicyActivity(final long intervalInSeconds) { if (activityChecker != null) { activityChecker.cancel(); } // send a message to ourselves: activityChecker = getContext().system().scheduler() .scheduleOnce(Duration.apply(intervalInSeconds, TimeUnit.SECONDS), getSelf(), new CheckForActivity(lastSequenceNr(), accessCounter), getContext().dispatcher(), null); }