Expand description
Core’s side of the protocol: spawn a plugin, negotiate a version, send requests.
Frames are read on a background thread so core can time out a silent plugin during the
handshake and never blocks forever on a plugin that has died. stderr is drained on another
thread, forwarded to a log sink and kept (last lines) for error messages. A plugin’s log and
progress messages (protocol 1) go to the same sink.
Structs§
- Canceller
- Asks a running request to stop, from any thread (see
PluginProcess::canceller), and can kill the plugin. - Description
- A plugin’s
describereply. - Plugin
Info - Plugin
Process - Stderr
Sync - Waits for a plugin’s stderr to be logged. Lines reach the
LogSinkfrom a background thread, so a line the plugin wrote before answering a request can be logged after core has the answer. A host that logs a request’s lines differently (hiding them while the request carries a secret) syncs before it changes how it logs.
Enums§
Constants§
- DEFAULT_
HANDSHAKE_ TIMEOUT - INTERACTIVE_
ENV - Set to
1in a plugin’s environment when a person is at core’s terminal, else0.
Functions§
- cancel_
all - Send
cancelto every running plugin’s current request (protocol 1). Returns how many had one. - kill_
all - Kill every running plugin process.
- running
- How many plugin processes are running.
- set_
core_ version - Set the DRE version sent to plugins in the handshake (
core_version). This crate is versioned on its own, so the host names the version of DRE it’s part of; unset, it’s “unreleased”. - stderr_
log - A log sink that prefixes each plugin line with the plugin’s file name, on core’s stderr.