SleepSystem

cats.effect.unsafe.SleepSystem$
object SleepSystem extends PollingSystem

Attributes

Source
SleepSystem.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Types

type Api = AnyRef

The user-facing interface.

The user-facing interface.

Attributes

Source
SleepSystem.scala
type Poller = AnyRef

The thread-local data structure used for polling.

The thread-local data structure used for polling.

Attributes

Source
SleepSystem.scala

Value members

Concrete methods

def close(): Unit

Closes the polling system.

Closes the polling system.

Attributes

Source
SleepSystem.scala
def closePoller(Poller: Poller): Unit

Closes a specific poller.

Closes a specific poller.

Value parameters

poller

the poller to be closed.

Attributes

Source
SleepSystem.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
SleepSystem.scala
def makeApi(register: (Poller => Unit) => Unit): Api

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
SleepSystem.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
SleepSystem.scala
def needsPoll(poller: Poller): Boolean

Attributes

Returns

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

Source
SleepSystem.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
SleepSystem.scala