Rule 190p-in-accept
Comments
An incoming value is an event of its own, so it is never handled in the middle of another step; its messages join the end of the queue, and are handled by later updates. Each leaf subscription on gives one message, through the functions of the s around it; a leaf on another port, or of another manager, gives none, and so does a leaf whose functions give no result. The order of the messages of one value follows the enumeration of , and is unspecified. A value accepted while no subscription is current gives no message.
Referred to from
- The comment on rule
p-in-reject(Chapter 9)
TeX source
\defnrule[r:p-in-accept]
{\PE(\effp)=(\smdirin,\tau)\premsep\Dec{\tau}(j)=v'\premsep
\effFlat(\sbv)=\effmset{\effc_1,\ldots,\effc_n}\\
\text{for}\ 1\leq i\leq n:\ \ \effrecv{\effc_i}{(\effp,j)}{M_i},\\
\text{or}\ M_i=\pgnil\ \text{and}\
\effrecv{\effc_i}{(\effp,j)}{v''}\ \text{for no}\ v''}
{(s,v,M,P,\sbv,Q,H)\step{\pgEvIn(\effp,j)}
(s,v,M\cdot M_1\cdots M_n,P,\sbv,Q,H)}Tests (10)
- elm / CoreIssue1141UnusedPortCallBreaksSubscriptionTestAn unused port call (`_ = echoOut "unused"` in `init`) breaks a port subscription elsewhere.
- elm / PortEchoTestAn `Int` sent out through an outgoing port comes back unchanged through an incoming port.
- elm / PortIncomingRejectTestA value that does not decode at an incoming port's type is rejected, and the program goes on.
- elm / PortPipeBytesRejectTestA JSON value sent to a `Bytes` port is rejected, whatever it holds.
- elm / PortPipeBytesTestA byte sequence received at `Bytes` goes out again as the same byte sequence.
- elm / PortPipeRejectTestValues that do not decode at an incoming port's type are rejected, and the program goes on.
- elm / PortPipeValueRejectsBytesTestA byte sequence sent to a `Json.Encode.Value` port is rejected, alone or inside an object.
- 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-in-accept] 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.