scheduleCallable

inline fun <V> TaskScheduler.scheduleCallable(cron: String, crossinline command: () -> V): ScheduledFuture<V>

Extension for TaskScheduler.schedule providing a scheduleCallable("0 0 12 * * ?") { doWork() } variant.

Return

a ScheduledFuture that can be used to extract the result or cancel

Author

Alejandro Gomez

Since

1.0.0

Parameters

cron

The cron expression

command

The task to execute


inline fun <V> TaskScheduler.scheduleCallable(delay: Duration, crossinline command: () -> V): ScheduledFuture<V>

Extension for TaskScheduler.schedule providing a scheduleCallable(delay) { doWork() } variant.

Return

a ScheduledFuture that can be used to the extract result or cancel

Author

Alejandro Gomez

Since

1.0.0

Parameters

delay

The time from now to delay execution

command

The task to execute