@[inline]
Set up a Sleep that waits for duration milliseconds.
This function only initializes but does not yet start the timer.
Equations
- Std.Internal.IO.Async.Sleep.mk duration = do let native ← liftM (Std.Internal.UV.Timer.mk (Std.Time.Internal.UnitVal.toInt duration).toNat.toUInt64 false) pure { native := native }
Instances For
@[inline]
If:
sis not yet running start it and return anAsynccomputation that will complete once the previously configureddurationhas elapsed.sis already or not anymore running return the sameAsynccomputation as the first call towait.
Equations
Instances For
@[inline]
If:
sis still running this stopsswithout completing any remainingAsynccomputations that were created throughwait. Note that if anotherAsynccomputation is binding on any of these it will hang forever without further intervention.sis not yet or not anymore running this is a no-op.
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
- Std.Internal.IO.Async.sleep duration = do let sleeper ← Std.Internal.IO.Async.Sleep.mk duration sleeper.wait
Instances For
Return a Selector that completes after duration.
Equations
- Std.Internal.IO.Async.Selector.sleep duration = do let sleeper ← Std.Internal.IO.Async.Sleep.mk duration pure sleeper.selector
Instances For
@[inline]
Setup up an Interval that waits for duration milliseconds.
This function only initializes but does not yet start the timer.
Equations
- Std.Internal.IO.Async.Interval.mk duration x✝ = do let native ← Std.Internal.UV.Timer.mk (Std.Time.Internal.UnitVal.toInt duration).toNat.toUInt64 true pure { native := native }
Instances For
@[inline]
If:
iis not yet running start it and return anAsynccomputation that completes right away as the 0th multiple ofdurationhas elapsed.iis already running and:- the tick from the last call of
ihas not yet finished return the sameAsynccomputation as the last call - the tick from the last call of
ihas finished return a newAsynccomputation that waits for the closest next tick from the time of calling this function.
- the tick from the last call of
iis not running anymore this is a no-op.
Equations
Instances For
@[inline]
If:
Interval.tickwas called onibefore the timer restarts counting from now and the next tick happens induration.iis not yet or not anymore running this is a no-op.
Instances For
@[inline]
If:
iis still running this stopsiwithout completing any remainingAsynccomputations that were created throughtick. Note that if anotherAsynccomputation is binding on any of these it will hang forever without further intervention.iis not yet or not anymore running this is a no-op.