BroadcastFrameClock

class BroadcastFrameClock(onNewAwaiters: () -> Unit?) : MonotonicFrameClock

A simple frame clock.

This implementation is intended for low-contention environments involving low total numbers of threads in a pool on the order of ~number of CPU cores available for UI recomposition work, while avoiding additional allocation where possible.

onNewAwaiters will be invoked whenever the number of awaiters has changed from 0 to 1.

Constructors

BroadcastFrameClock
Link copied to clipboard
common
fun BroadcastFrameClock(onNewAwaiters: () -> Unit? = null)

Functions

equals
Link copied to clipboard
common
open operator fun equals(other: Any?): Boolean
fold
Link copied to clipboard
common
open override fun <R> fold(initial: R, operation: (R, CoroutineContext.Element) -> R): R
get
Link copied to clipboard
common
open operator override fun <E : CoroutineContext.Element> get(key: CoroutineContext.Key<E>): E?
hashCode
Link copied to clipboard
common
open fun hashCode(): Int
minusKey
Link copied to clipboard
common
open override fun minusKey(key: CoroutineContext.Key<*>): CoroutineContext
plus
Link copied to clipboard
common
open operator fun plus(context: CoroutineContext): CoroutineContext
sendFrame
Link copied to clipboard
common
fun sendFrame(timeNanos: Long)
toString
Link copied to clipboard
common
open fun toString(): String
withFrameNanos
Link copied to clipboard
common
open suspend override fun <R> withFrameNanos(onFrame: (Long) -> R): R
Suspends until a new frame is requested, immediately invokes onFrame with the frame time in nanoseconds in the calling context of frame dispatch, then resumes with the result from onFrame.

Properties

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