InterestSuspensionsMap

A thread-safe map that manages suspensions for different SelectInterest types.

This class is used internally by the selector to track coroutine continuations waiting for specific I/O operations (read, write, accept, connect) to become ready.

Report a problem

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard

Registers a suspension continuation for the specified interest.

Link copied to clipboard

Invokes the given block for each registered suspension, regardless of ready state. The suspensions are removed from the map before invoking the block. This is typically used for cleanup or cancellation.

inline fun invokeForEachPresent(readyOps: Int, block: CancellableContinuation<Unit>.() -> Unit)

Invokes the given block for each registered suspension whose interest matches the readyOps flags. The matching suspensions are removed from the map before invoking the block.

Link copied to clipboard

Removes and returns the suspension registered for the specified interest.

Removes and returns the suspension registered for the interest at the given ordinal index.

Link copied to clipboard
open override fun toString(): String