pub struct RtHandle { /* private fields */ }Available on crate feature
distributed only.Expand description
A real-time handle to a Graph that can be atomically swapped without
stopping the RT thread.
Wrap a compiled Graph in an RtHandle; the RT thread drives cycles via
RtHandle::process_cycle, and the control thread publishes replacements
via RtHandle::install.
§Example
let handle = RtHandle::new(compiled_graph);
// RT thread:
let mut ctx = ProcessContext::new(256, 0, 48_000);
handle.process_cycle(&mut ctx).unwrap();
// Control thread — publish a freshly-built graph without stopping RT:
let new_graph: Graph = { /* ...rebuild + recompile... */ Graph::new() };
handle.install(new_graph);Implementations§
Source§impl RtHandle
impl RtHandle
Sourcepub fn install(&self, graph: Graph)
pub fn install(&self, graph: Graph)
Atomically publishes a new graph. Control thread only.
The previously-installed graph is dropped once no RT cycle holds a guard
to it (epoch-based reclamation via arc-swap).
Sourcepub fn process_cycle(&self, ctx: &mut ProcessContext) -> Result<(), GraphError>
pub fn process_cycle(&self, ctx: &mut ProcessContext) -> Result<(), GraphError>
Loads the current graph and runs one RT cycle.
Wait-free load (arc-swap); the graph’s Graph::process_cycle is
allocation-free. Returns GraphError::NotCompiled if the loaded graph
was never compiled.
§Errors
Propagates GraphError from Graph::process_cycle.
Auto Trait Implementations§
impl !Freeze for RtHandle
impl !RefUnwindSafe for RtHandle
impl !UnwindSafe for RtHandle
impl Send for RtHandle
impl Sync for RtHandle
impl Unpin for RtHandle
impl UnsafeUnpin for RtHandle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more