Skip to main content

with_gateway

Function with_gateway 

Source
pub fn with_gateway<F, Fut, T>(op: F) -> Result<T>
where F: FnOnce(Arc<RpcIpcClient>) -> Fut, Fut: Future<Output = T>,
Expand description

Connect to the gateway daemon and run op with a live client. The tokio runtime that hosts the muxio connection is kept alive for the whole op, so RPCs complete (dropping it early would tear down the connection and hang the call). op receives an owned Arc and runs on that runtime.