ktor-network / io.ktor.network.selector

Package io.ktor.network.selector

Types

ActorSelectorManager

class ActorSelectorManager : SelectorManagerSupport, Closeable, CoroutineScope

Default CIO selector manager implementation

ClosedChannelCancellationException

class ClosedChannelCancellationException

InterestSuspensionsMap

class InterestSuspensionsMap

SelectInterest

enum expect class SelectInterest

Select interest kind

Selectable

expect interface Selectable

A selectable entity with selectable NIO channel, interestedOps subscriptions.

SelectorManager

expect interface SelectorManager : CoroutineScope

SelectorManager interface allows Selectable wait for SelectInterest.

SelectorManagerSupport

abstract class SelectorManagerSupport : SelectorManager

Base class for NIO selector managers

Functions

SelectorManager

expect fun SelectorManager(dispatcher: <ERROR CLASS> = EmptyCoroutineContext): SelectorManager

Creates the selector manager for current platform.

buildOrClose

fun <C, R> SelectorManager.buildOrClose(create: SelectorProvider.() -> C, setup: C.() -> R): R

Creates a NIO entity via create and calls setup on it. If any exception happens then the entity will be closed and an exception will be propagated.