Package io.camunda.zeebe.util.sched
Class TimerSubscription
java.lang.Object
io.camunda.zeebe.util.sched.TimerSubscription
- All Implemented Interfaces:
ActorSubscription,ScheduledTimer,Runnable
public final class TimerSubscription
extends Object
implements ActorSubscription, ScheduledTimer, Runnable
-
Constructor Summary
ConstructorsConstructorDescriptionTimerSubscription(ActorJob job, long deadline, TimeUnit timeUnit, boolean isRecurring) -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()longgetJob()called by theActorThreadafterActorSubscription.poll()returned true to get the job to be runlongbooleanReturns true in case the subscription is recurring (ie.voidcallback received as the job returned byActorSubscription.getJob()completes execution.voidonTimerExpired(TimeUnit timeUnit, long now) booleanpoll()called by theActorThreadto determine whether the subscription has work available.voidrun()voidsetTimerId(long timerId) voidsubmit()toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.camunda.zeebe.util.sched.ActorSubscription
triggersInPhase
-
Constructor Details
-
TimerSubscription
-
-
Method Details
-
poll
public boolean poll()Description copied from interface:ActorSubscriptioncalled by theActorThreadto determine whether the subscription has work available.- Specified by:
pollin interfaceActorSubscription
-
getJob
Description copied from interface:ActorSubscriptioncalled by theActorThreadafterActorSubscription.poll()returned true to get the job to be run- Specified by:
getJobin interfaceActorSubscription
-
isRecurring
public boolean isRecurring()Description copied from interface:ActorSubscriptionReturns true in case the subscription is recurring (ie. after the job finished, the subscription is re-created- Specified by:
isRecurringin interfaceActorSubscription
-
onJobCompleted
public void onJobCompleted()Description copied from interface:ActorSubscriptioncallback received as the job returned byActorSubscription.getJob()completes execution.- Specified by:
onJobCompletedin interfaceActorSubscription
-
cancel
public void cancel()- Specified by:
cancelin interfaceActorSubscription- Specified by:
cancelin interfaceScheduledTimer
-
getTimerId
public long getTimerId() -
setTimerId
public void setTimerId(long timerId) -
submit
public void submit() -
getDeadline
public long getDeadline() -
getTimeUnit
-
onTimerExpired
-
run
public void run() -
toString
-