SelectorSystem

cats.effect.unsafe.SelectorSystem
See theSelectorSystem companion object
final class SelectorSystem extends PollingSystem

Attributes

Companion
object
Source
SelectorSystem.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Type members

Classlikes

final class Poller

The thread-local data structure used for polling.

The thread-local data structure used for polling.

Attributes

Source
SelectorSystem.scala
Supertypes
class Object
trait Matchable
class Any
final class SelectorImpl extends Selector

Attributes

Source
SelectorSystem.scala
Supertypes
trait Selector
class Object
trait Matchable
class Any

Types

type Api = Selector

The user-facing interface.

The user-facing interface.

Attributes

Source
SelectorSystem.scala

Value members

Concrete methods

def close(): Unit

Closes the polling system.

Closes the polling system.

Attributes

Source
SelectorSystem.scala
def closePoller(poller: Poller): Unit

Closes a specific poller.

Closes a specific poller.

Value parameters

poller

the poller to be closed.

Attributes

Source
SelectorSystem.scala
def interrupt(targetThread: Thread, targetPoller: Poller): Unit

Interrupts a specific target poller running on a specific target thread.

Interrupts a specific target poller running on a specific target thread.

Value parameters

targetPoller

is the poller to be interrupted.

targetThread

is the thread where the target poller is running.

Attributes

Source
SelectorSystem.scala
def makeApi(register: (Poller => Unit) => Unit): Selector

Creates a new instance of the user-facing interface.

Creates a new instance of the user-facing interface.

Value parameters

access

callback to obtain a thread-local Poller.

Attributes

Returns

an instance of the user-facing interface Api.

Source
SelectorSystem.scala

Creates a new instance of the thread-local data structure used for polling.

Creates a new instance of the thread-local data structure used for polling.

Attributes

Returns

an instance of the poller Poller.

Source
SelectorSystem.scala
def needsPoll(poller: Poller): Boolean

Attributes

Returns

whether poll should be called again (i.e., there are more events to be polled)

Source
SelectorSystem.scala
def poll(poller: Poller, nanos: Long, reportFailure: Throwable => Unit): Boolean

Value parameters

nanos

the maximum duration for which to block, where nanos == -1 indicates to block indefinitely.

poller

the thread-local Poller used to poll events.

reportFailure

callback that handles any failures that occur during polling.

Attributes

Returns

whether any events were polled. e.g. if the method returned due to timeout, this should be false.

Source
SelectorSystem.scala