Documentation

Std.Internal.Async.Timer

Sleep can be used to sleep for some duration once. The underlying timer has millisecond resolution.

Instances For
    @[inline]

    Set up a Sleep that waits for duration milliseconds. This function only initializes but does not yet start the timer.

    Equations
    Instances For
      @[inline]

      If:

      • s is not yet running start it and return an Async computation that will complete once the previously configured duration has elapsed.
      • s is already or not anymore running return the same Async computation as the first call to wait.
      Equations
      Instances For
        @[inline]

        If:

        • s is still running the timer restarts counting from now and completes after duration milliseconds.
        • s is not yet or not anymore running this is a no-op.
        Equations
        Instances For
          @[inline]

          If:

          • s is still running this stops s without completing any remaining Async computations that were created through wait. Note that if another Async computation is binding on any of these it will hang forever without further intervention.
          • s is not yet or not anymore running this is a no-op.
          Equations
          Instances For

            Create a Selector that resolves once s has finished. s only starts when it runs inside of a Selectable.

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

              Return an Async computation that completes after duration.

              Equations
              Instances For

                Return a Selector that completes after duration.

                Equations
                Instances For

                  Interval can be used to repeatedly wait for some duration like a clock. The underlying timer has millisecond resolution.

                  Instances For
                    @[inline]

                    Setup up an Interval that waits for duration milliseconds. This function only initializes but does not yet start the timer.

                    Equations
                    Instances For
                      @[inline]

                      If:

                      • i is not yet running start it and return an Async computation that completes right away as the 0th multiple of duration has elapsed.
                      • i is already running and:
                        • the tick from the last call of i has not yet finished return the same Async computation as the last call
                        • the tick from the last call of i has finished return a new Async computation that waits for the closest next tick from the time of calling this function.
                      • i is not running anymore this is a no-op.
                      Equations
                      Instances For
                        @[inline]

                        If:

                        • Interval.tick was called on i before the timer restarts counting from now and the next tick happens in duration.
                        • i is not yet or not anymore running this is a no-op.
                        Equations
                        Instances For
                          @[inline]

                          If:

                          • i is still running this stops i without completing any remaining Async computations that were created through tick. Note that if another Async computation is binding on any of these it will hang forever without further intervention.
                          • i is not yet or not anymore running this is a no-op.
                          Equations
                          Instances For