ScopedExecutor

class ScopedExecutor(executor: Executor) : Executor

Wraps an existing executor to provide a .shutdown method that allows subsequent cancellation of submitted runnables.

Constructors

Link copied to clipboard
fun ScopedExecutor(executor: Executor)

Functions

Link copied to clipboard
open override fun execute(command: Runnable)
Link copied to clipboard
fun shutdown()

After this method is called, no runnables that have been submitted or are subsequently submitted will start to execute, turning this executor into a no-op.