pub trait IPCProvider:
Environment
+ Send
+ Sync {
// Required methods
fn SendNotificationToSideCar<'life0, 'async_trait>(
&'life0 self,
SideCarIdentifier: String,
Method: String,
Parameters: Value,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn SendRequestToSideCar<'life0, 'async_trait>(
&'life0 self,
SideCarIdentifier: String,
Method: String,
Parameters: Value,
TimeoutMilliseconds: u64,
) -> Pin<Box<dyn Future<Output = Result<Value, CommonError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
An abstract service contract for an environment component that can
communicate with external sidecar processes (like Cocoon).
This trait is implemented by MountainEnvironment and typically uses gRPC
as the underlying transport mechanism to send and receive messages.
Required Methods§
Sourcefn SendNotificationToSideCar<'life0, 'async_trait>(
&'life0 self,
SideCarIdentifier: String,
Method: String,
Parameters: Value,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn SendNotificationToSideCar<'life0, 'async_trait>(
&'life0 self,
SideCarIdentifier: String,
Method: String,
Parameters: Value,
) -> Pin<Box<dyn Future<Output = Result<(), CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sends a notification (a fire-and-forget message) to a specified sidecar. This method does not wait for a response.
§Parameters
SideCarIdentifier: The unique ID of the target sidecar process.Method: The name of the notification method to be invoked on the sidecar.Parameters: Aserde_json::Valuecontaining the parameters for the notification.
Sourcefn SendRequestToSideCar<'life0, 'async_trait>(
&'life0 self,
SideCarIdentifier: String,
Method: String,
Parameters: Value,
TimeoutMilliseconds: u64,
) -> Pin<Box<dyn Future<Output = Result<Value, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn SendRequestToSideCar<'life0, 'async_trait>(
&'life0 self,
SideCarIdentifier: String,
Method: String,
Parameters: Value,
TimeoutMilliseconds: u64,
) -> Pin<Box<dyn Future<Output = Result<Value, CommonError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sends a request to a specified sidecar and awaits a response.
§Parameters
SideCarIdentifier: The unique ID of the target sidecar process.Method: The name of the RPC method to be invoked on the sidecar.Parameters: Aserde_json::Valuecontaining the parameters for the request.TimeoutMilliseconds: The maximum time to wait for a response before failing.
§Returns
A Result containing the serde_json::Value response from the
sidecar.