ScheduledDispatchQueue

A DispatchQueue that uses a ScheduledThreadPoolExecutor to schedule tasks to be executed in the future.

Uses a default pool size of 8. Custom values can be provided during construction

Constructors

Link copied to clipboard
constructor(poolSize: Int = 8)

Functions

Link copied to clipboard
open override fun queue(delay: Long, unit: TimeUnit, runnable: () -> Unit): DispatchWorkItem

Queue a Runnable to be executed after a given time unit delay

Link copied to clipboard
open override fun queueAtFixedRate(delay: Long, period: Long, unit: TimeUnit, runnable: () -> Unit): DispatchWorkItem

Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the given period; that is, executions will commence after initialDelay, then initialDelay + period, then initialDelay + 2 * period, and so on.