Rule 192p-out
Comments
The values of each port are delivered in the order in which they joined its queue, so a value sent by one update is delivered before a value that a later update sends on the same port. Delivery happens after the step that queued the value, at a time the definition does not fix, and in no fixed order across ports. The event records only that the program has delivered ; whether the host has a subscriber, and what it does with , are outside the definition.
TeX source
\defnrule[r:p-out]
{Q(\effp)=j\cdot J}
{(s,v,M,P,\sbv,Q,H)\step{\pgEvOut(\effp,j)}(s,v,M,P,\sbv,Q+\{\effp\mapsto J\},H)}Tests (6)
- elm / CoreIssue1141UnusedPortCallBreaksSubscriptionTestAn unused port call (`_ = echoOut "unused"` in `init`) breaks a port subscription elsewhere.
- elm / MinimalPipeIntTestA pipe at `Int`: the value the driver sends in comes back out.
- elm / PortPipeBytesTestA byte sequence received at `Bytes` goes out again as the same byte sequence.
- elm / PortPipeValueTestA JSON value received at `Json.Encode.Value` goes out again as the same JSON value.
- elm-core / CoreIssue1110PortDeclarationOrderTestA subscription returned together with a port command is active in time to receive that command's synchronous reply.
- elm-core / CoreIssue1154PortSubscribedWithCmdTestA port subscription added by the same `update` that sends a command to an outgoing port misses the outgoing port's synchronous reply, depending on the order of the ports in the generated code.
Discussions
Discuss this rule·Search the discussions on GitHub
Discussions are on GitHub; one about this rule has [r:p-out] 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.