Package akka.stream.stage
Class TimerGraphStageLogic
- java.lang.Object
-
- akka.stream.stage.GraphStageLogic
-
- akka.stream.stage.TimerGraphStageLogic
-
- Direct Known Subclasses:
TimerGraphStageLogicWithLogging
public abstract class TimerGraphStageLogic extends GraphStageLogic
Provides timer related facilities to aGraphStageLogic
.To be thread safe the methods of this class must only be called from either the constructor of the graph operator during materialization or one of the methods invoked by the graph operator machinery, such as
onPush
andonPull
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class akka.stream.stage.GraphStageLogic
GraphStageLogic.ConditionalTerminateInput, GraphStageLogic.ConditionalTerminateOutput, GraphStageLogic.EagerTerminateInput$, GraphStageLogic.EagerTerminateOutput$, GraphStageLogic.IgnoreTerminateInput$, GraphStageLogic.IgnoreTerminateOutput$, GraphStageLogic.StageActor, GraphStageLogic.StageActorRef$, GraphStageLogic.StageActorRefNotInitializedException, GraphStageLogic.StageActorRefNotInitializedException$, GraphStageLogic.SubSinkInlet<T>, GraphStageLogic.SubSourceOutlet<T>, GraphStageLogic.TotallyIgnorantInput$
-
-
Constructor Summary
Constructors Constructor Description TimerGraphStageLogic(Shape _shape)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
afterPostStop()
INTERNAL APIprotected void
cancelTimer(java.lang.Object timerKey)
Cancel timer, ensuring that theonTimer(java.lang.Object)
is not subsequently called.protected boolean
isTimerActive(java.lang.Object timerKey)
Inquire whether the timer is still active.protected void
onTimer(java.lang.Object timerKey)
Will be called when the scheduled timer is triggered.protected void
scheduleAtFixedRate(java.lang.Object timerKey, java.time.Duration initialDelay, java.time.Duration interval)
Schedule timer to callonTimer(java.lang.Object)
periodically with the giveninterval
after the specified initial delay.protected void
scheduleAtFixedRate(java.lang.Object timerKey, scala.concurrent.duration.FiniteDuration initialDelay, scala.concurrent.duration.FiniteDuration interval)
Schedule timer to callonTimer(java.lang.Object)
periodically with the giveninterval
after the specified initial delay.protected void
scheduleOnce(java.lang.Object timerKey, java.time.Duration delay)
Schedule timer to callonTimer(java.lang.Object)
after given delay.protected void
scheduleOnce(java.lang.Object timerKey, scala.concurrent.duration.FiniteDuration delay)
Schedule timer to callonTimer(java.lang.Object)
after given delay.protected void
schedulePeriodically(java.lang.Object timerKey, java.time.Duration interval)
Deprecated.Use scheduleWithFixedDelay or scheduleAtFixedRate instead.protected void
schedulePeriodically(java.lang.Object timerKey, scala.concurrent.duration.FiniteDuration interval)
Deprecated.Use scheduleWithFixedDelay or scheduleAtFixedRate instead.protected void
schedulePeriodicallyWithInitialDelay(java.lang.Object timerKey, java.time.Duration initialDelay, java.time.Duration interval)
Deprecated.Use scheduleWithFixedDelay or scheduleAtFixedRate instead.protected void
schedulePeriodicallyWithInitialDelay(java.lang.Object timerKey, scala.concurrent.duration.FiniteDuration initialDelay, scala.concurrent.duration.FiniteDuration interval)
Deprecated.Use scheduleWithFixedDelay or scheduleAtFixedRate instead.protected void
scheduleWithFixedDelay(java.lang.Object timerKey, java.time.Duration initialDelay, java.time.Duration interval)
Schedule timer to callonTimer(java.lang.Object)
periodically with the givendelay
after the specified initial delay.protected void
scheduleWithFixedDelay(java.lang.Object timerKey, scala.concurrent.duration.FiniteDuration initialDelay, scala.concurrent.duration.FiniteDuration delay)
Schedule timer to callonTimer(java.lang.Object)
periodically with the givendelay
after the specified initial delay.-
Methods inherited from class akka.stream.stage.GraphStageLogic
abortEmitting, abortReading, beforePreStart, cancel, cancel, cancelStage, complete, completeStage, conditionalTerminateInput, conditionalTerminateOutput, createAsyncCallback, eagerTerminateInput, eagerTerminateOutput, emit, emit, emit, emitMultiple, emitMultiple, emitMultiple, emitMultiple, emitMultiple, emitMultiple, fail, failStage, getAsyncCallback, getEagerStageActor, getHandler, getHandler, getStageActor, grab, hasBeenPulled, ignoreTerminateInput, ignoreTerminateOutput, inCount, isAvailable, isAvailable, isClosed, isClosed, materializer, outCount, passAlong, passAlong$default$3, passAlong$default$4, passAlong$default$5, postStop, preStart, pull, push, read, read, readN, readN, setHandler, setHandler, setHandlers, setKeepGoing, stageActor, stageActorName, subFusingMaterializer, toString, totallyIgnorantInput, tryPull
-
-
-
-
Constructor Detail
-
TimerGraphStageLogic
public TimerGraphStageLogic(Shape _shape)
-
-
Method Detail
-
afterPostStop
protected void afterPostStop()
Description copied from class:GraphStageLogic
INTERNAL API- Overrides:
afterPostStop
in classGraphStageLogic
-
cancelTimer
protected final void cancelTimer(java.lang.Object timerKey)
Cancel timer, ensuring that theonTimer(java.lang.Object)
is not subsequently called.- Parameters:
timerKey
- key of the timer to cancel
-
isTimerActive
protected final boolean isTimerActive(java.lang.Object timerKey)
Inquire whether the timer is still active. Returns true unless the timer does not exist, has previously been canceled or if it was a single-shot timer that was already triggered.
-
onTimer
protected void onTimer(java.lang.Object timerKey) throws java.lang.Exception
Will be called when the scheduled timer is triggered.- Parameters:
timerKey
- key of the scheduled timer- Throws:
java.lang.Exception
-
scheduleAtFixedRate
protected final void scheduleAtFixedRate(java.lang.Object timerKey, scala.concurrent.duration.FiniteDuration initialDelay, scala.concurrent.duration.FiniteDuration interval)
Schedule timer to callonTimer(java.lang.Object)
periodically with the giveninterval
after the specified initial delay. Any existing timer with the same key will automatically be canceled before adding the new timer.
-
scheduleAtFixedRate
protected final void scheduleAtFixedRate(java.lang.Object timerKey, java.time.Duration initialDelay, java.time.Duration interval)
Schedule timer to callonTimer(java.lang.Object)
periodically with the giveninterval
after the specified initial delay. Any existing timer with the same key will automatically be canceled before adding the new timer.
-
scheduleOnce
protected final void scheduleOnce(java.lang.Object timerKey, scala.concurrent.duration.FiniteDuration delay)
Schedule timer to callonTimer(java.lang.Object)
after given delay. Any existing timer with the same key will automatically be canceled before adding the new timer.
-
scheduleOnce
protected final void scheduleOnce(java.lang.Object timerKey, java.time.Duration delay)
Schedule timer to callonTimer(java.lang.Object)
after given delay. Any existing timer with the same key will automatically be canceled before adding the new timer.
-
schedulePeriodically
protected final void schedulePeriodically(java.lang.Object timerKey, scala.concurrent.duration.FiniteDuration interval)
Deprecated.Use scheduleWithFixedDelay or scheduleAtFixedRate instead. This has the same semantics as scheduleAtFixedRate, but scheduleWithFixedDelay is often preferred. Since 2.6.0.Schedule timer to callonTimer(java.lang.Object)
periodically with the given interval. Any existing timer with the same key will automatically be canceled before adding the new timer.
-
schedulePeriodically
protected final void schedulePeriodically(java.lang.Object timerKey, java.time.Duration interval)
Deprecated.Use scheduleWithFixedDelay or scheduleAtFixedRate instead. This has the same semantics as scheduleAtFixedRate, but scheduleWithFixedDelay is often preferred. Since 2.6.0.Schedule timer to callonTimer(java.lang.Object)
periodically with the given interval. Any existing timer with the same key will automatically be canceled before adding the new timer.
-
schedulePeriodicallyWithInitialDelay
protected final void schedulePeriodicallyWithInitialDelay(java.lang.Object timerKey, scala.concurrent.duration.FiniteDuration initialDelay, scala.concurrent.duration.FiniteDuration interval)
Deprecated.Use scheduleWithFixedDelay or scheduleAtFixedRate instead. This has the same semantics as scheduleAtFixedRate, but scheduleWithFixedDelay is often preferred. Since 2.6.0.Schedule timer to callonTimer(java.lang.Object)
periodically with the given interval after the specified initial delay. Any existing timer with the same key will automatically be canceled before adding the new timer.
-
schedulePeriodicallyWithInitialDelay
protected final void schedulePeriodicallyWithInitialDelay(java.lang.Object timerKey, java.time.Duration initialDelay, java.time.Duration interval)
Deprecated.Use scheduleWithFixedDelay or scheduleAtFixedRate instead. This has the same semantics as scheduleAtFixedRate, but scheduleWithFixedDelay is often preferred. Since 2.6.0.Schedule timer to callonTimer(java.lang.Object)
periodically with the given interval after the specified initial delay. Any existing timer with the same key will automatically be canceled before adding the new timer.
-
scheduleWithFixedDelay
protected final void scheduleWithFixedDelay(java.lang.Object timerKey, scala.concurrent.duration.FiniteDuration initialDelay, scala.concurrent.duration.FiniteDuration delay)
Schedule timer to callonTimer(java.lang.Object)
periodically with the givendelay
after the specified initial delay. Any existing timer with the same key will automatically be canceled before adding the new timer.
-
scheduleWithFixedDelay
protected final void scheduleWithFixedDelay(java.lang.Object timerKey, java.time.Duration initialDelay, java.time.Duration interval)
Schedule timer to callonTimer(java.lang.Object)
periodically with the givendelay
after the specified initial delay. Any existing timer with the same key will automatically be canceled before adding the new timer.
-
-