Skip to content

Commit

Permalink
refactor(torii): different tasks for torii services (#2552)
Browse files Browse the repository at this point in the history
  • Loading branch information
Larkooo authored Oct 18, 2024
1 parent 3508fb9 commit 1d67c67
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions bin/torii/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,19 @@ async fn main() -> anyhow::Result<()> {
.await?;
}

let engine_handle = tokio::spawn(async move { engine.start().await });
let proxy_server_handle =
tokio::spawn(async move { proxy_server.start(shutdown_tx.subscribe()).await });
let graphql_server_handle = tokio::spawn(graphql_server);
let grpc_server_handle = tokio::spawn(grpc_server);
let libp2p_relay_server_handle = tokio::spawn(async move { libp2p_relay_server.run().await });

tokio::select! {
res = engine.start() => res?,
_ = proxy_server.start(shutdown_tx.subscribe()) => {},
_ = graphql_server => {},
_ = grpc_server => {},
_ = libp2p_relay_server.run() => {},
res = engine_handle => res??,
res = proxy_server_handle => res??,
res = graphql_server_handle => res?,
res = grpc_server_handle => res??,
res = libp2p_relay_server_handle => res?,
_ = dojo_utils::signal::wait_signals() => {},
};

Expand Down

0 comments on commit 1d67c67

Please sign in to comment.