Rule 185p-proc-sleep
Transitions
(185)
Comments
The process reached by its step at time , so the action takes place no sooner than milliseconds later; for an infinite or NaN delay, no condition is imposed. The definition sets no time by which the action must take place.
Referred to from
- The comment on rule
p-wait(Chapter 9)
TeX source
\defnrule[r:p-proc-sleep]
{P(\pid)=(\tk,s',\pgorig)\premsep\tk\effred{\effa}\tk'\premsep
\effa=\effdone{\effsleep(v')}{\tk''}\\
\text{if}\ v'\in\effFltFin\ \text{then}\ s\geq s'+\max(0,v')}
{(s,v,M,P,\sbv,Q,H)\step{\effa}
(s,v,M,P+\{\pid\mapsto(\tk',s,\pgorig)\},\sbv,Q,H)}Tests (8)
- elm / MinimalSleepTestA process sleeps, and time passes.
- elm / OutgoingPortTuple3KeepsRunningTestA program that sends a 3-tuple through an outgoing port keeps running afterwards.
- elm-core / ProcessPrimitiveOutcomeTestThe primitive tasks `Process.sleep`, `Process.spawn` and `Process.kill` succeed with their outcomes.
- elm-core / ProcessSpawnKillHalfTestA process killed with `Process.kill` before its sleep finishes never runs the rest of its task, while the processes left alive do.
- elm-core / ProcessSpawnRecursiveTestA process spawned with `Process.spawn` can itself spawn a process, nested five deep, and every level runs.
- elm-core / ProcessYieldThrashingTestTwo processes that each repeatedly yield with `Process.sleep 0` both run to completion.
- elm-core / StandardA81SleepBeyond32BitsTest`Process.sleep d` waits at least `d` milliseconds, also when `d` is above 2^31 - 1.
- elm-core / TimerEffectTestA `Platform.worker` that chains `Process.sleep` timers through `Task.perform` receives each timer message in turn and stops after five.
Discussions
Discuss this rule·Search the discussions on GitHub
Discussions are on GitHub; one about this rule has [r:p-proc-sleep] in its title.
A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.