pub struct CpuKernel { /* private fields */ }Expand description
CPU-based kernel implementation.
Implementations§
Source§impl CpuKernel
impl CpuKernel
Sourcepub fn new(id: KernelId, options: LaunchOptions, node_id: u64) -> Self
pub fn new(id: KernelId, options: LaunchOptions, node_id: u64) -> Self
Create a new CPU kernel.
Sourcepub fn new_with_k2k(
id: KernelId,
options: LaunchOptions,
node_id: u64,
k2k_endpoint: Option<K2KEndpoint>,
) -> Self
pub fn new_with_k2k( id: KernelId, options: LaunchOptions, node_id: u64, k2k_endpoint: Option<K2KEndpoint>, ) -> Self
Create a new CPU kernel with optional K2K endpoint.
Sourcepub fn state(&self) -> KernelState
pub fn state(&self) -> KernelState
Get current state.
Sourcepub fn process_message(&self, envelope: MessageEnvelope) -> Result<()>
pub fn process_message(&self, envelope: MessageEnvelope) -> Result<()>
Process one message (for testing).
Sourcepub fn handle(self: &Arc<Self>) -> KernelHandle
pub fn handle(self: &Arc<Self>) -> KernelHandle
Create a handle to this kernel.
Sourcepub fn is_k2k_enabled(&self) -> bool
pub fn is_k2k_enabled(&self) -> bool
Check if K2K messaging is enabled for this kernel.
Sourcepub async fn k2k_send(
&self,
destination: KernelId,
envelope: MessageEnvelope,
) -> Result<DeliveryReceipt>
pub async fn k2k_send( &self, destination: KernelId, envelope: MessageEnvelope, ) -> Result<DeliveryReceipt>
Send a K2K message to another kernel.
Sourcepub fn k2k_try_recv(&self) -> Option<K2KMessage>
pub fn k2k_try_recv(&self) -> Option<K2KMessage>
Try to receive a K2K message (non-blocking).
Sourcepub async fn k2k_recv(&self) -> Option<K2KMessage>
pub async fn k2k_recv(&self) -> Option<K2KMessage>
Receive a K2K message (blocking).
Trait Implementations§
Source§impl KernelHandleInner for CpuKernel
impl KernelHandleInner for CpuKernel
Source§fn kernel_id_num(&self) -> u64
fn kernel_id_num(&self) -> u64
Get numeric kernel ID.
Source§fn current_timestamp(&self) -> HlcTimestamp
fn current_timestamp(&self) -> HlcTimestamp
Get current timestamp.
Source§fn activate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn activate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Activate kernel.
Source§fn deactivate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn deactivate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Deactivate kernel.
Source§fn terminate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn terminate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Terminate kernel.
Source§fn send_envelope<'life0, 'async_trait>(
&'life0 self,
envelope: MessageEnvelope,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_envelope<'life0, 'async_trait>(
&'life0 self,
envelope: MessageEnvelope,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send message envelope.
Source§fn receive<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<MessageEnvelope>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn receive<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<MessageEnvelope>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Receive message.
Source§fn receive_timeout<'life0, 'async_trait>(
&'life0 self,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<MessageEnvelope>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn receive_timeout<'life0, 'async_trait>(
&'life0 self,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = Result<MessageEnvelope>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Receive with timeout.
Source§fn try_receive(&self) -> Result<MessageEnvelope>
fn try_receive(&self) -> Result<MessageEnvelope>
Try receive (non-blocking).
Receive correlated response.
Source§fn status(&self) -> KernelStatus
fn status(&self) -> KernelStatus
Get status.
Source§fn metrics(&self) -> KernelMetrics
fn metrics(&self) -> KernelMetrics
Get metrics.
Auto Trait Implementations§
impl !Freeze for CpuKernel
impl !RefUnwindSafe for CpuKernel
impl Send for CpuKernel
impl Sync for CpuKernel
impl Unpin for CpuKernel
impl !UnwindSafe for CpuKernel
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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.