Documentation

Std.Sync.CancellationToken

This module contains the implementation of Std.CancellationToken. Std.CancellationToken provides a cancellation primitive for signaling cancellation between tasks or threads. It supports both synchronous and asynchronous waiting, and is useful for cases where you want to notify one or more waiters that a cancellation has occurred.

Instances For

    The central state structure for a CancellationToken.

    • cancelled : Bool

      Whether this token has been cancelled.

    • consumers : Queue Consumer

      Consumers that are blocked waiting for cancellation. #

    Instances For

      A cancellation token is a synchronization primitive that allows multiple consumers to wait until cancellation is requested.

      Instances For

        Create a new cancellation token.

        Equations
        Instances For

          Cancel the token, notifying all currently waiting consumers with true. Once cancelled, the token remains cancelled.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            Check if the token is cancelled.

            Equations
            Instances For

              Wait for cancellation. Returns a task that completes when cancelled,

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                Creates a selector that waits for cancellation

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For