Expand description
Pending<T> – the typed handle returned by every mutating
actor call (DESIGN.md §5.2.1).
A Pending wraps a tokio::sync::oneshot::Receiver. Three usage
patterns:
- Async caller (LSP client, plugin host, future async UI):
pending.awaityields the typed result. - Sync caller in a tokio context (test fixtures running
#[tokio::test]): same as above. - Sync caller outside tokio (the TUI input loop, which is a
blocking
crossterm::event::readloop on the main thread):pending.blocking_recv()parks the current thread until the actor responds. The TUI usescrate::runtime::block_onwhich forwards to this.
Errors are kept narrow: RuntimeError::ActorGone when the
actor task has shut down before it could respond, and
RuntimeError::Core for any inner [lattice_core::CoreError]
(range out of bounds, etc.). The previous Busy variant was
removed in audit slice 6 / H3 – the document actor’s mailbox
is now unbounded, so backpressure surfaces as queue depth
rather than per-call drops.
Structs§
- Invocation
Id - Monotonic id assigned to every actor-bound invocation. Unique across the process – not reused if an actor task dies and is respawned. Useful for telemetry, logging, and (post-Phase-7) for plugin-side correlation of request/response.
- Pending
- Outcome of an actor-bound mutation. Wraps a oneshot receiver so the caller can await (or block on) the result.
Enums§
- Runtime
Error - Failure modes a runtime caller can observe. Kept narrow so the UI can branch on the failure shape rather than a generic message.