-
- All Implemented Interfaces:
public final class ScheduledExecutorServiceExtKt
-
-
Method Summary
Modifier and Type Method Description final static ScheduledFuture<?>scheduleWithFixedDelay(ScheduledExecutorService $self, Boolean startImmediately, Function0<Long> delayProvider, Function0<TimeUnit> timeUnitProvider, Function0<Unit> command)We can't use standard ScheduledExecutorService.scheduleWithFixedDelay method when configuration (delay and time unit) can be change at any time. -
-
Method Detail
-
scheduleWithFixedDelay
final static ScheduledFuture<?> scheduleWithFixedDelay(ScheduledExecutorService $self, Boolean startImmediately, Function0<Long> delayProvider, Function0<TimeUnit> timeUnitProvider, Function0<Unit> command)
We can't use standard ScheduledExecutorService.scheduleWithFixedDelay method when configuration (delay and time unit) can be change at any time. That's why we might need an ability of rescheduling task using actual runtime values after each execution. This extension solves that problem.
Another feature it provides is that it catches any uncaught exceptions, logs them and doesn't kill the current thread.
-
-
-
-