SyncEventLoop

open class SyncEventLoop(var precise: Boolean = false, var immediateRun: Boolean = false) : BaseEventLoop, Pauseable

Inheritors

Constructors

Link copied to clipboard
constructor(precise: Boolean = false, immediateRun: Boolean = false)

Properties

Link copied to clipboard

Execute timers immediately instead of waiting. Useful for testing.

Link copied to clipboard
Link copied to clipboard
open override var paused: Boolean
Link copied to clipboard

precise=true will have better precision at the cost of more CPU-usage (busy waiting)

Link copied to clipboard

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun runAvailableNextTask(runTimers: Boolean = true): Boolean
Link copied to clipboard
fun runAvailableNextTasks(runTimers: Boolean = true): Int
Link copied to clipboard
fun runTasksForever(runWhile: () -> Boolean = { true })
Link copied to clipboard
Link copied to clipboard
open override fun setImmediate(task: () -> Unit)
Link copied to clipboard
fun setImmediateFirst(task: () -> Unit)
Link copied to clipboard
open override fun setInterval(time: TimeSpan, task: () -> Unit): Closeable
Link copied to clipboard
fun EventLoop.setInterval(time: Frequency, task: () -> Unit): Closeable
Link copied to clipboard
open fun setIntervalFrame(task: () -> Unit): Closeable
Link copied to clipboard
open override fun setTimeout(time: TimeSpan, task: () -> Unit): Closeable
Link copied to clipboard
open fun start()
Link copied to clipboard
open fun stop()
Link copied to clipboard