Package io.activej.async.service
Class TaskScheduler
java.lang.Object
io.activej.reactor.AbstractReactive
io.activej.async.service.TaskScheduler
- All Implemented Interfaces:
ReactiveService,ReactiveJmxBean,ReactiveJmxBeanWithStats,Reactive
public final class TaskScheduler
extends AbstractReactive
implements ReactiveService, ReactiveJmxBeanWithStats
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classstatic interface -
Field Summary
Fields inherited from class io.activej.reactor.AbstractReactive
reactor -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TaskScheduler.Builderbuilder(Reactor reactor, AsyncSupplier<T> task) long@Nullable Duration@Nullable Exception@Nullable DurationgetStats()booleanvoidvoidsetEnabled(boolean enabled) voidsetInterval(Duration interval) voidvoidsetRetryPolicy(RetryPolicy<?> retryPolicy) voidsetSchedule(TaskScheduler.Schedule schedule) Promise<?>start()Starts this component asynchronously.voidstartNow()Promise<?>stop()Stops this component asynchronously.Methods inherited from class io.activej.reactor.AbstractReactive
getReactorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.activej.reactor.Reactive
getReactorMethods inherited from interface io.activej.reactor.jmx.ReactiveJmxBeanWithStats
getSmoothingWindow, setSmoothingWindowMethods inherited from interface io.activej.async.service.ReactiveService
startFuture, stopFuture
-
Method Details
-
resetStats
public void resetStats()- Specified by:
resetStatsin interfaceReactiveJmxBeanWithStats
-
builder
-
start
Description copied from interface:ReactiveServiceStarts this component asynchronously. Callback completes immediately if the component is already running.- Specified by:
startin interfaceReactiveService
-
stop
Description copied from interface:ReactiveServiceStops this component asynchronously. Callback completes immediately if the component is not running / already stopped.- Specified by:
stopin interfaceReactiveService
-
setSchedule
-
setRetryPolicy
-
isEnabled
public boolean isEnabled() -
setEnabled
public void setEnabled(boolean enabled) -
getStats
-
getLastException
-
getInitialDelay
public long getInitialDelay() -
getPeriod
-
setPeriod
-
getInterval
-
setInterval
-
startNow
public void startNow()
-