MCPcopy Create free account
hub / github.com/hashintel/hash / block_on

Function block_on

apps/hash-graph/src/subcommand/mod.rs:144–159  ·  view source on GitHub ↗
(
    future: impl Future<Output = Result<(), Report<GraphError>>>,
    service_name: &'static str,
    tracing_config: TracingConfig,
)

Source from the content-addressed store, hash-verified

142}
143
144fn block_on(
145 future: impl Future<Output = Result<(), Report<GraphError>>>,
146 service_name: &'static str,
147 tracing_config: TracingConfig,
148) -> Result<(), Report<GraphError>> {
149 tokio::runtime::Builder::new_multi_thread()
150 .enable_all()
151 .build()
152 .expect("failed to create runtime")
153 .block_on(async {
154 let _telemetry_guard = init_tracing(tracing_config, service_name)
155 .expect("should be able to initialize telemetry");
156
157 future.await
158 })
159}
160
161impl Subcommand {
162 pub(crate) fn execute(self, tracing_config: TracingConfig) -> Result<(), Report<GraphError>> {

Callers 4

executeMethod · 0.85
attach_futureFunction · 0.85
attach_futureFunction · 0.85
attach_futureFunction · 0.85

Calls 3

init_tracingFunction · 0.50
expectMethod · 0.45
buildMethod · 0.45

Tested by 3

attach_futureFunction · 0.68
attach_futureFunction · 0.68
attach_futureFunction · 0.68