Skip to main content

Module decoration_task

Module decoration_task 

Source
Expand description

PH7.9b — the per-plugin actor bridge for decoration providers.

The decoration analogue of completion_task.rs: a dedicated async task owns the plugin’s Store<PluginState> for life (the Store is !Sync), a DecorationCall crosses an mpsc channel with a oneshot reply, and the Send + Sync DecorationClient serializes calls onto the single-consumer loop. PluginHost::spawn_decoration_source instantiates the decorations-plugin world under the plugin’s grant and returns (DecorationClient, DecorationActor); the caller drives DecorationActor::run on its multi-thread runtime (the lib owns no runtime).

Like completion (PH7.6), this is a producer, host-called OFF the render path — the host calls produce on a trigger (edit / scroll / diagnostic change), caches the result, and the renderer reads the cache (never WASM on the tick, paramount #1). The picker / completion / decoration actors are near-identical request/reply bridges; generalising the loop over the bindings type is deferred until a real need (the completion_task rule-of-three note).

Re-exports§

pub use crate::lattice::plugin_host::types::DecorationContext;
pub use crate::lattice::plugin_host::types::GutterDecoration;

Structs§

DecorationActor
The per-plugin actor: owns the Store + decoration bindings for the plugin’s life and serves calls off the channel until every DecorationClient drops.
DecorationClient
The Send + Sync handle a caller holds. Cloning is cheap (an mpsc Sender clone); every clone talks to the same actor / Store, so calls serialize on the single-consumer loop the !Sync Store needs.