Skip to main content

run_concurrently

Function run_concurrently 

Source
pub async fn run_concurrently<HF, GF, HE, GE>(
    http_future: HF,
    grpc_future: GF,
) -> Result<()>
where HF: Future<Output = Result<(), HE>> + Send, GF: Future<Output = Result<(), GE>> + Send, HE: Error + Send + Sync + 'static, GE: Error + Send + Sync + 'static,
Expand description

Run two independent servers/tasks concurrently.

This is useful for running a RustAPI HTTP server together with a Tonic gRPC server.

The function returns when one of the futures returns an error, or when both complete successfully.