Skip to main content

Module plugin_poller

Module plugin_poller 

Source
Expand description

Phase 96 — daemon-side plugin poller router.

Plugins declare [plugin.poller] kinds = [...] in their nexo-plugin.toml. The daemon’s poller runner consults this router for every job in pollers.yaml: if the job’s kind belongs to a registered plugin, the router builds the broker request topic <broker_topic_prefix>.tick and forwards the tick payload via JSON-RPC; the subprocess replies with the same TickAck shape the in-process trait returns.

Mirrors crate::plugin_admin / crate::plugin_http: interior-mutability via RwLock so the daemon can construct an empty router at boot and populate it AFTER plugin manifests load + supervisor wires.

Structs§

EphemeralPollerProxy
Phase 96.E — daemon-side Poller impl that spawns a fresh subprocess per tick, drives the tick over stdio JSON-RPC, kills the child on reply. Used when the plugin manifest declares lifecycle = "ephemeral".
PluginPollerHandle
One registered plugin’s poller capability.
PluginPollerProxy
Daemon-side Poller impl that proxies every tick to a subprocess plugin via broker JSON-RPC. Registered with the runner alongside in-tree builtins so the runner sees a single homogeneous registry.
PluginPollerRouter
Daemon-side router. Looks up which plugin owns a kind and forwards tick requests via broker JSON-RPC.
TickReply
Plugin reply to a tick request. Wire-compatible with TickAck but carries cursor as base64 so the message survives any text-only broker transport.
TickRequest
JSON-RPC tick request payload. The plugin subprocess receives this verbatim and replies with TickReply.

Enums§

PluginPollerForwardError
PollerRouteRegistrationError

Functions§

build_tick_request
Build the JSON-RPC tick request from runner inputs. Pure fn so the caller (or a future test harness) can exercise the wire shape without a broker.
encode_cursor
forward_tick
Forward a tick request to the plugin via broker JSON-RPC. Caller owns the TickRequest construction so this fn can be a thin IO wrapper. Returns the parsed TickReply; conversion to TickAck is the runner’s concern.
spawn_ephemeral_tick
Spawn the binary, write the tick request to stdin, read one JSON line from stdout, await exit, classify the reply.