DefaultExecutionContext

class DefaultExecutionContext(shutdownGracePeriod: Duration = Duration.ofSeconds(30)) : ExecutionContext(source)

A ExecutionContext that runs its polling cycle on a background (virtual) thread and which, on stop, waits for in-flight work to finish for up to shutdownGracePeriod before giving up.

Constructors

Link copied to clipboard
constructor(shutdownGracePeriod: Duration = Duration.ofSeconds(30))

Functions

Link copied to clipboard
open override fun currentTime(): Instant
Link copied to clipboard
open override fun isRunning(): Boolean
Link copied to clipboard
open override fun pause(duration: Duration)
Link copied to clipboard
open override fun start(runnable: Runnable)
Link copied to clipboard
open override fun stop(): Boolean

Stop the processing cycle, allowing in-flight work to finish within the context's shutdown grace period.