pub struct K2KBroker { /* private fields */ }Expand description
K2K message broker for routing messages between kernels.
Implementations§
Source§impl K2KBroker
impl K2KBroker
Sourcepub fn register(self: &Arc<Self>, kernel_id: KernelId) -> K2KEndpoint
pub fn register(self: &Arc<Self>, kernel_id: KernelId) -> K2KEndpoint
Register a kernel endpoint.
Sourcepub fn unregister(&self, kernel_id: &KernelId)
pub fn unregister(&self, kernel_id: &KernelId)
Unregister a kernel endpoint.
Sourcepub fn is_registered(&self, kernel_id: &KernelId) -> bool
pub fn is_registered(&self, kernel_id: &KernelId) -> bool
Check if a kernel is registered.
Sourcepub fn registered_kernels(&self) -> Vec<KernelId>
pub fn registered_kernels(&self) -> Vec<KernelId>
Get all registered kernels.
Sourcepub async fn send(
&self,
source: KernelId,
destination: KernelId,
envelope: MessageEnvelope,
) -> Result<DeliveryReceipt>
pub async fn send( &self, source: KernelId, destination: KernelId, envelope: MessageEnvelope, ) -> Result<DeliveryReceipt>
Send a message from one kernel to another.
Sourcepub async fn send_priority(
&self,
source: KernelId,
destination: KernelId,
envelope: MessageEnvelope,
priority: u8,
) -> Result<DeliveryReceipt>
pub async fn send_priority( &self, source: KernelId, destination: KernelId, envelope: MessageEnvelope, priority: u8, ) -> Result<DeliveryReceipt>
Send a priority message.
Sourcepub fn add_route(&self, destination: KernelId, next_hop: KernelId)
pub fn add_route(&self, destination: KernelId, next_hop: KernelId)
Add a route to the routing table.
Sourcepub fn remove_route(&self, destination: &KernelId)
pub fn remove_route(&self, destination: &KernelId)
Remove a route from the routing table.
Sourcepub fn get_receipt(&self, message_id: &MessageId) -> Option<DeliveryReceipt>
pub fn get_receipt(&self, message_id: &MessageId) -> Option<DeliveryReceipt>
Get delivery receipt for a message.
Auto Trait Implementations§
impl !Freeze for K2KBroker
impl !RefUnwindSafe for K2KBroker
impl Send for K2KBroker
impl Sync for K2KBroker
impl Unpin for K2KBroker
impl UnwindSafe for K2KBroker
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.