SendRequest

Function SendRequest 

Source
pub async fn SendRequest(
    SideCarIdentifier: &str,
    Method: String,
    Parameters: Value,
    TimeoutMilliseconds: u64,
) -> Result<Value, VineError>
Expand description

Sends a request to a sidecar and waits for a response.

This is the primary method for request-response communication with sidecars. It implements timeout handling and automatic connection validation.

§Parameters

  • SideCarIdentifier: Unique identifier of the target sidecar
  • Method: RPC method name to call
  • Parameters: JSON parameters for the RPC call
  • TimeoutMilliseconds: Maximum time to wait for response (default: 5000ms)

§Returns

  • Ok(Value): JSON response from the sidecar
  • Err(VineError): Request failed or timed out

§Example

use serde_json::json;
let result =
	SendRequest("cocoon-main".to_string(), "GetExtensions".to_string(), json!({}), 5000)
		.await?;