Package io.activej.async.service
Class EventloopTaskScheduler
- java.lang.Object
-
- io.activej.async.service.EventloopTaskScheduler
-
- All Implemented Interfaces:
EventloopService,io.activej.common.initializer.WithInitializer<EventloopTaskScheduler>,EventloopJmxBean,EventloopJmxBeanEx
public final class EventloopTaskScheduler extends Object implements EventloopService, io.activej.common.initializer.WithInitializer<EventloopTaskScheduler>, EventloopJmxBeanEx
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceEventloopTaskScheduler.Schedule
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.activej.eventloop.jmx.EventloopJmxBeanEx
getSmoothingWindow, resetStats, setSmoothingWindow
-
Methods inherited from interface io.activej.async.service.EventloopService
startFuture, stopFuture
-
-
-
-
Method Detail
-
create
public static <T> EventloopTaskScheduler create(Eventloop eventloop, AsyncSupplier<T> task)
-
withInitialDelay
public EventloopTaskScheduler withInitialDelay(Duration initialDelay)
-
withSchedule
public EventloopTaskScheduler withSchedule(EventloopTaskScheduler.Schedule schedule)
-
withPeriod
public EventloopTaskScheduler withPeriod(Duration period)
-
withInterval
public EventloopTaskScheduler withInterval(Duration interval)
-
withRetryPolicy
public EventloopTaskScheduler withRetryPolicy(RetryPolicy<?> retryPolicy)
-
withAbortOnError
public EventloopTaskScheduler withAbortOnError(boolean abortOnError)
-
withStatsHistogramLevels
public EventloopTaskScheduler withStatsHistogramLevels(int[] levels)
-
getEventloop
@NotNull public @NotNull Eventloop getEventloop()
- Specified by:
getEventloopin interfaceEventloopJmxBean- Specified by:
getEventloopin interfaceEventloopService
-
start
@NotNull public @NotNull Promise<Void> start()
Description copied from interface:EventloopServiceStarts this component asynchronously. Callback completes immediately if the component is already running.- Specified by:
startin interfaceEventloopService
-
stop
@NotNull public @NotNull Promise<Void> stop()
Description copied from interface:EventloopServiceStops this component asynchronously. Callback completes immediately if the component is not running / already stopped.- Specified by:
stopin interfaceEventloopService
-
setSchedule
public void setSchedule(EventloopTaskScheduler.Schedule schedule)
-
setRetryPolicy
public void setRetryPolicy(RetryPolicy<?> retryPolicy)
-
isEnabled
public boolean isEnabled()
-
setEnabled
public void setEnabled(boolean enabled)
-
getStats
public PromiseStats getStats()
-
getLastException
@Nullable public @Nullable Throwable getLastException()
-
getInitialDelay
public long getInitialDelay()
-
getPeriod
@Nullable public @Nullable Duration getPeriod()
-
setPeriod
public void setPeriod(Duration period)
-
getInterval
@Nullable public @Nullable Duration getInterval()
-
setInterval
public void setInterval(Duration interval)
-
startNow
public void startNow()
-
-