Skip to main content

DispatchConversation

Trait DispatchConversation 

Source
pub trait DispatchConversation: Debug + Send {
    // Required methods
    fn link_worker(
        &mut self,
        worker: &DispatchWorker,
    ) -> Result<(), AionSurfaceError>;
    fn send(&mut self, request: DispatchRequest) -> Result<(), AionSurfaceError>;
    fn receive(&mut self) -> Result<DispatchConversationEvent, AionSurfaceError>;
    fn close(&mut self) -> Result<(), AionSurfaceError>;
}
Expand description

Open dispatch conversation with typed zero-hop request and response methods.

Required Methods§

Links a selected worker process before the request is sent.

§Errors

Returns an error if the process link cannot be established.

Source

fn send(&mut self, request: DispatchRequest) -> Result<(), AionSurfaceError>

Sends a typed dispatch request through the conversation.

§Errors

Returns an error if the conversation cannot accept the request.

Source

fn receive(&mut self) -> Result<DispatchConversationEvent, AionSurfaceError>

Receives either a worker response or a linked-process exit event.

§Errors

Returns an error if the conversation cannot receive an event.

Source

fn close(&mut self) -> Result<(), AionSurfaceError>

Closes the conversation boundary.

§Errors

Returns an error if the conversation cannot close normally.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§