Skip to main content

Module media_task

Module media_task 

Source
Expand description

IM.6b — the per-plugin actor bridge for inline-media providers.

The media analogue of decoration_task.rs, and deliberately its near-twin: a dedicated async task owns the plugin’s Store<PluginState> for life (the Store is !Sync), a [MediaCall] crosses an mpsc channel with a oneshot reply, and the Send + Sync MediaClient serialises calls onto the single-consumer loop.

A producer, host-called OFF the render path: the host calls produce on a trigger (buffer opened, edited), caches the result, and the renderer reads the cache. WASM on the tick would be a paramount-#1 violation.

Generalising the picker / completion / decoration / media actors over their bindings type is still deferred — this is the fourth near-copy, so the rule-of-three note in completion_task has now been earned and the generalisation is worth doing the next time one of them changes shape.

Re-exports§

pub use crate::lattice::plugin_host::types::DecorationContext;
pub use crate::lattice::plugin_host::types::MediaBlock;
pub use crate::lattice::plugin_host::types::MediaFit;

Structs§

MediaActor
The per-plugin actor: owns the Store + media bindings for the plugin’s life and serves calls off the channel until every MediaClient drops.
MediaClient
The Send + Sync handle a caller holds. Cloning is cheap; every clone talks to the same actor / Store, so calls serialise on the single-consumer loop the !Sync Store requires.