Skip to main content

Module ctx

Module ctx 

Source
Expand description

A command task’s context channel (decisions 143-146): the agent’s side of schedr dag-ctx and schedr.script.

The task inherits one end of a datagram socket pair (SCHEDR_CTX_FD), and so does every process it starts. A call makes a stream socket pair of its own and sends one end over it (SCM_RIGHTS, one datagram); the agent serves each received end as a connection of its own (see schedr_model::ctx), until the attempt ends. A caller is accepted by the protocol it speaks, not its schedr version (decision 148). The agent never sends on the datagram socket, so concurrent callers can’t take each other’s answers.

Structs§

CtxInfo
What a task’s processes can read over the channel.
Serving
Serving a channel; stops (its connections closed) when dropped.

Enums§

CtxError
Why a conversation ended early.

Constants§

MAX_CONNECTIONS
The most connections a task may have open at once; an end sent beyond it is closed at once (the caller sees the connection close).

Functions§

channel
A new channel: the agent’s end, and the task’s end to pass to its process (close-on-exec, as every socket the agent makes; made inheritable only while that process starts).
converse
One connection: the handshake, then one answer per request until the caller closes it.
serve
Serves the agent’s end of a channel in the background, until the returned guard drops.