@[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 an- Asynccomputation that will complete once the previously configured- durationhas elapsed.
- sis already or not anymore running return the same- Asynccomputation as the first call to- wait.
Equations
Instances For
@[inline]
If:
- sis still running this stops- swithout completing any remaining- Asynccomputations that were created through- wait. Note that if another- Asynccomputation 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 an- Asynccomputation that completes right away as the 0th multiple of- durationhas 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 on- ibefore the timer restarts counting from now and the next tick happens in- duration.
- iis not yet or not anymore running this is a no-op.
Instances For
@[inline]
If:
- iis still running this stops- iwithout completing any remaining- Asynccomputations that were created through- tick. Note that if another- Asynccomputation 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.