Documentation

Std.Sync.CancellationContext

This module provides a tree-structured cancellation context called CancellationToken where cancelling a parent automatically cancels all child contexts.

A cancellation context that allows multiple consumers to wait until cancellation is requested. Forms a tree structure where cancelling a parent cancels all children.

Instances For

    Creates a new root cancellation context.

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

      Forks a child context from a parent. If the parent is already cancelled, returns the parent context. Otherwise, creates a new child that will be cancelled when the parent is cancelled.

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

        Cancels this context and all child contexts with the given reason.

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

          Checks if the context is cancelled.

          Equations
          Instances For
            @[inline]

            Returns the cancellation reason if the context is cancelled.

            Equations
            Instances For
              @[inline]

              Waits for cancellation. Returns a task that completes when the context is cancelled.

              Equations
              Instances For
                @[inline]

                Creates a selector that waits for cancellation.

                Equations
                Instances For

                  Counts the number of alive (non-cancelled) tokens in the context tree, including this context and all its descendants.

                  Equations
                  Instances For