Overview

  • class Barrier
    • public

    A general purpose synchronisation primitive, which allows one task to wait for a number of other tasks to complete. It can be used in conjunction with class Async::Semaphore.

  • class Cancel

    Raised when a task is explicitly cancelled.

    • class Cause

      Represents the source of the cancel operation.

    • class Later

      Used to defer cancelling the current task until later.

  • class Clock
    • public

    A convenient wrapper around the internal monotonic clock.

  • class Condition
    • public

    A synchronization primitive, which allows fibers to wait until a particular condition is (edge) triggered.

  • module Console

    Shims for the console gem, redirecting warnings and above to Kernel#warn.

  • class Deadline
    • public

    Represents a deadline timeout with decrementing remaining time.

    • module Zero

      Singleton module for immediate timeouts (zero or negative).

  • class TimeoutError
    • public

    Raised if a timeout occurs on a specific Fiber. Handled gracefully by Task.

  • module ForkHandler

    Private module that hooks into Process._fork to handle fork events.

    • class Idler

      A load balancing mechanism that can be used process work when the system is idle.

    • class LimitedQueue
      • public

      A thread-safe queue which limits the number of items that can be enqueued.

    • class List

      A general doublely linked list. This is used internally by class Async::Barrier and class Async::Condition to manage child tasks.

    • module Loop
    • class Children

      A list of children tasks.

    • class Node

      A node in a tree, used for implementing the task hierarchy.

    • class Notification
      • public

      A synchronization primitive, which allows fibers to wait until a notification is received. Does not block the task which signals the notification. Waiting tasks are resumed on next iteration of the reactor.

    • class PriorityQueue
      • public

      A queue which allows items to be processed in priority order of consumers.

    • class Promise
      • public

      A promise represents a value that will be available in the future.

    • class Queue
      • asynchronous
      • public

      A thread-safe queue which allows items to be processed in order.

      • class ClosedError
        • public

        An error raised when trying to enqueue items to a closed queue.

      • class Reactor

        A wrapper around the the scheduler which binds it to the current thread automatically.

      • class Scheduler

        Handles scheduling of fibers. Implements the fiber scheduler interface.

      • class Semaphore
        • public

        A synchronization primitive, which limits access to a given resource.

      • class Task
        • public

        Represents a sequential unit of work, defined by a block, which is executed concurrently with other tasks. A task can be in one of the following states: initialized, running, completed, failed, or cancelled.

        • class FinishedError

          Raised when a child task is created within a task that has finished execution.

      • class Timeout
        • public

        Represents a flexible timeout that can be rescheduled or extended.

      • class Variable
        • deprecated

        A synchronization primitive that allows one task to wait for another task to resolve a value.

      • class Waiter
        • deprecated

        A composable synchronization primitive, which allows one task to wait for a number of other tasks to complete. It can be used in conjunction with class Async::Semaphore and/or class Async::Barrier.