Skip to main content

Module host

Module host 

Source
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 describe reply.
PluginInfo
PluginProcess

Enums§

Execution
The outcome of a source execute.
HostError
Incoming
A message from the plugin.

Constants§

DEFAULT_HANDSHAKE_TIMEOUT
INTERACTIVE_ENV
Set to 1 in a plugin’s environment when a person is at core’s terminal, else 0.

Functions§

cancel_all
Send cancel to 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.

Type Aliases§

LogSink
Receives each line a plugin logs: (plugin, line). A log message arrives prefixed by its level (info: , warning: for warn and error, debug: for debug and trace), as does progress (info: ); a stderr line arrives as written.
Result