CoroutineTimings

The spigot timings require a reference to the runnable to display the name of timings correctly. Now, Kotlin Coroutines does not allow to directly pass a runnable object, because a single coroutine may consist out of multiple runnables. This class is a workaround coroutine context element, which can be passed along the minecraftDispatcher to display a valid name for the coroutine.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard

Key identifier of the context element.

Properties

Link copied to clipboard
open override val key: CoroutineContext.Key<*>
Link copied to clipboard

Multiple tasks can be assigned to a single coroutine. We implement this by a queue.

Functions

Link copied to clipboard
open override fun <R> fold(initial: R, operation: (R, CoroutineContext.Element) -> R): R
Link copied to clipboard
open operator override fun <E : CoroutineContext.Element> get(key: CoroutineContext.Key<E>): E?
Link copied to clipboard
open override fun minusKey(key: CoroutineContext.Key<*>): CoroutineContext
Link copied to clipboard
open operator fun plus(context: CoroutineContext): CoroutineContext
Link copied to clipboard
open override fun run()

When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run method to be called in that separately executing thread.