Skip to main content

Module rpc

Module rpc 

Source
Expand description

The Capโ€™n Proto RPC interface of the server, one method for each call of proto/conmon.capnp.

Macrosยง

capnp_err ๐Ÿ”’
enter_request ๐Ÿ”’
Enter the root span of a request for the rest of the handler, with the parent context the client sent.
pry_err ๐Ÿ”’

Structsยง

ExecSyncOutput ๐Ÿ”’
The result of an exec_sync.

Functionsยง

exec_deadline ๐Ÿ”’
The deadline of an exec_sync, none without a timeout or if it does not fit, which is no timeout either.
exec_sync_output ๐Ÿ”’
Read the output of an exec while waiting for its exit, and take the result from the watcher alone. The watcher cancels the token once it reaped the process or killed it at its timeout, the drain bounds the reading after that. A deadline of the reading on its own would race the one of the watcher, and report a timeout with the exit code of a process which exited right at it, without its last output. A watcher which got lost never cancels the token, nothing ends the process and its output otherwise, like for a streaming exec, so it gets killed with kill. Cancelling the token then stops the output, see StopOutput.
idle_timeout ๐Ÿ”’
The idle timeout of a streaming connection, none for 0.
reject_retired ๐Ÿ”’
Fail a request which sets one of the retired fields, which an older client may send, named like they were, see the schema. Ignoring one would change what the runtime does, like its root through globalArgs or the descriptors it inherits through additionalFds, or the journal entries of a container through the tag of a log driver. Empty ones, which the older clients send by default, pass. A client since v1.1.0 checks the feature of the sdnotifySocket before it sends one.
set_parent_context ๐Ÿ”’
Make the context the client sent in the metadata of a request the parent of its span, before the span got entered. Metadata which cannot be read does not fail the request, it only loses the parent.
spawn_logged ๐Ÿ”’
Run the part of a call which must finish also if capnp-rpc drops the call, like once the client disconnects, in a task of its own, see task_result. Its error gets logged here as well, the client may be gone or have its reply already.
streaming_result ๐Ÿ”’
The result of a request for the URL of a streaming session. Without a context: clients match the start of the message, like the one of too many waiting sessions, see ErrTooManyRequests of the Go client.
task_result ๐Ÿ”’
The result of a call which runs in a task of its own. A task which panicked fails the call like an error, but only where panics unwind, like in the tests: release builds abort on a panic.
text_list ๐Ÿ”’
Read a text list of a request, like into strings or paths.