Packages

c

cats.effect.unsafe

PollingSystem

abstract class PollingSystem extends AnyRef

Represents a stateful system for managing and interacting with a polling system. Polling systems are typically used in scenarios such as handling multiplexed blocking I/O or other event-driven systems, where one needs to repeatedly check (or "poll") some condition or state, blocking up to some timeout until it is ready.

This class abstracts the general components and actions of a polling system, such as:

  • The user-facing interface (API) which interacts with the outside world
  • The thread-local data structure used for polling, which keeps track of the internal state of the system and its events
  • The lifecycle management methods, such as creating and closing the polling system and its components
  • The runtime interaction methods, such as polling events and interrupting the process
Source
PollingSystem.scala
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PollingSystem
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new PollingSystem()

Type Members

  1. abstract type Api <: AnyRef

    The user-facing interface.

  2. abstract type Poller <: AnyRef

    The thread-local data structure used for polling.

Abstract Value Members

  1. abstract def close(): Unit

    Closes the polling system.

  2. abstract def closePoller(poller: Poller): Unit

    Closes a specific poller.

    Closes a specific poller.

    poller

    the poller to be closed.

  3. abstract 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.

    targetThread

    is the thread where the target poller is running.

    targetPoller

    is the poller to be interrupted.

  4. abstract def makeApi(access: ((Poller) ⇒ Unit) ⇒ Unit): Api

    Creates a new instance of the user-facing interface.

    Creates a new instance of the user-facing interface.

    access

    callback to obtain a thread-local Poller.

    returns

    an instance of the user-facing interface Api.

  5. abstract def makePoller(): Poller

    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.

    returns

    an instance of the poller Poller.

  6. abstract def needsPoll(poller: Poller): Boolean

    returns

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

  7. abstract def poll(poller: Poller, nanos: Long, reportFailure: (Throwable) ⇒ Unit): Boolean

    poller

    the thread-local Poller used to poll events.

    nanos

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

    reportFailure

    callback that handles any failures that occur during polling.

    returns

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

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  16. def toString(): String
    Definition Classes
    AnyRef → Any
  17. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped