Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(torii): different tasks for torii services #2552

Merged
merged 6 commits into from
Oct 18, 2024
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading