Enqueue

Tag 2: the client sends a message to the agent, which starts a loop when none runs and joins the queue when one does; the server answers with exactly one channel response, the fate of the message, when the fate is known.

The client opens this channel to send a message to the agent. A message sent while no loop runs starts one, as its input; a message sent while one runs is placed in its queue, and the agent takes it at a seam of its own choosing. Nothing interrupts a loop. What the agent says in reply is the main stream of the scope, as Response states.

  • The request. The tag byte 2 followed by the message as JSON. Request states its form.
  • The response. Exactly one channel response, sent when the fate of the message is known, however long that takes, and the channel response finish. Response states the sequence.
  • Order. Messages are taken in the order the client sent them.
  • A loop ending. A loop that ends with a message still waiting does not lose it: the server starts the next loop on every message still waiting, their content concatenated into one, in the order sent. A container that refuses that content refuses every message of it.
  • No timeout. The server holds the channel open until the fate is known.