Trait bee_runtime::node::Node [−][src]
A trait representing a node framework through which node workers may communicate.
Associated Types
type Builder: NodeBuilder<Self>[src]
The builder type used to create instances of this node.
type Backend: StorageBackend[src]
The storage backend used by this node.
type Error: Error[src]
The type of errors that may be emitted as a result of the build process.
Required methods
#[must_use]fn stop<'async_trait>(
self
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where
Self: 'async_trait, [src]
self
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>> where
Self: 'async_trait,
Stop the node, ending the execution of all workers in a timely manner.
fn spawn<W, G, F>(&mut self, g: G) where
W: Worker<Self>,
G: FnOnce(Receiver<()>) -> F,
F: Future<Output = ()> + Send + 'static, [src]
W: Worker<Self>,
G: FnOnce(Receiver<()>) -> F,
F: Future<Output = ()> + Send + 'static,
Spawn a new node task associated with the given worker.
The task will be shut down with the worker to preserve topological worker ordering.
fn worker<W>(&self) -> Option<&W> where
W: Worker<Self> + Send + Sync, [src]
W: Worker<Self> + Send + Sync,
Get a reference to the state of a worker.
fn register_resource<R: Any + Send + Sync>(&mut self, res: R)[src]
Register a new resource with the node such that other workers may access it via Node::resource.
fn remove_resource<R: Any + Send + Sync>(&mut self) -> Option<R>[src]
Attempt to remove a resource from the node, returning None if no such resource was registered with the node.
fn resource<R: Any + Send + Sync>(&self) -> ResourceHandle<R>[src]
Obtain an owning handle to a node resource.
Provided methods
fn info(&self) -> ResourceHandle<NodeInfo>[src]
Obtain an owning handle to the node's info.
fn storage(&self) -> ResourceHandle<Self::Backend>[src]
Obtain an owning handle to the node's storage backend.
fn bus(&self) -> ResourceHandle<Bus<'static>>[src]
Obtain an owning handle to the node's event bus.