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()); }
Cancellable scheduler = getContext().system().scheduler().schedule( Duration.create( 0, TimeUnit.MILLISECONDS ), Duration.create( qakkaFig.getQueueRefreshMilliseconds(), TimeUnit.MILLISECONDS ), Cancellable scheduler = getContext().system().scheduler().schedule( Duration.create( 0, TimeUnit.SECONDS ), Duration.create( qakkaFig.getQueueTimeoutSeconds() / 2, TimeUnit.SECONDS ), Cancellable scheduler = getContext().system().scheduler().schedule( Duration.create( 0, TimeUnit.MILLISECONDS ), Duration.create( qakkaFig.getShardAllocationCheckFrequencyMillis(), TimeUnit.MILLISECONDS ),
/** * 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()); }
timeoutMessageCancellable = getContext() .system() .scheduler() .scheduleOnce(timeOutDuration, getSelf(), ExecutionManagerMsgType.OPERATION_TIMEOUT,
.scheduler() .scheduleOnce( Duration.create(httpPollerProcessor
.scheduler() .scheduleOnce( timeoutDuration,
.scheduler() .scheduleOnce( timeoutDuration,
.scheduler() .scheduleOnce( timeoutDuration,
private Cancellable internalSchedule(Runnable runnable, long delay, TimeUnit unit) { return actorSystem.scheduler().scheduleOnce( new FiniteDuration(delay, unit), runnable, actorSystem.dispatcher()); }
private Cancellable internalSchedule(Runnable runnable, long delay, TimeUnit unit) { return actorSystem.scheduler().scheduleOnce( new FiniteDuration(delay, unit), runnable, actorSystem.dispatcher()); }
private Cancellable scheduleReconnect() { final FiniteDuration initialDelay = FiniteDuration.apply(reconnectInitialDelay.toMillis(), TimeUnit.MILLISECONDS); final FiniteDuration interval = FiniteDuration.apply(reconnectInterval.toMillis(), TimeUnit.MILLISECONDS); final ReconnectMessages message = ReconnectMessages.START_RECONNECT; log.info("Scheduling reconnect for all connections with initial delay {} and interval {}.", reconnectInitialDelay, reconnectInterval); return getContext().getSystem() .scheduler() .schedule(initialDelay, interval, getSelf(), message, getContext().dispatcher(), 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 scheduleRegistrationListener(FiniteDuration interval) { LOG.debug("--->scheduleRegistrationListener called."); registrationSchedule = getContext().system().scheduler().schedule( interval, interval, getSelf(), new RegisterListener(), getContext().system().dispatcher(), getSelf()); }
public StatsSampleClient(String servicePath) { this.servicePath = servicePath; FiniteDuration interval = Duration.create(2, TimeUnit.SECONDS); tickTask = getContext() .system() .scheduler() .schedule(interval, interval, self(), "tick", getContext().dispatcher(), null); }
private void scheduleShutdown() { shutdownCancellable = getContext().getSystem().scheduler() .scheduleOnce(SHUTDOWN_DELAY, getSelf(), Shutdown.getInstance(), getContext().dispatcher(), ActorRef.noSender()); }