Skip to content

Commit

Permalink
opt(torii): parallalize event processing
Browse files Browse the repository at this point in the history
commit-id:b4b488fe
  • Loading branch information
lambda-0x committed Sep 5, 2024
1 parent 37887c9 commit 8a10542
Show file tree
Hide file tree
Showing 13 changed files with 634 additions and 265 deletions.
92 changes: 78 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ tower = "0.4.13"
tower-http = "0.4.4"
tracing = "0.1.34"
tracing-subscriber = { version = "0.3.16", features = [ "env-filter", "json" ] }
tracing-test = "0.1"
url = { version = "2.4.0", features = [ "serde" ] }

# server
Expand Down
6 changes: 3 additions & 3 deletions bin/torii/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ async fn main() -> anyhow::Result<()> {
let provider: Arc<_> = JsonRpcClient::new(HttpTransport::new(args.rpc)).into();

// Get world address
let world = WorldContractReader::new(args.world_address, &provider);
let world = WorldContractReader::new(args.world_address, Arc::clone(&provider));

let db = Sql::new(pool.clone(), args.world_address).await?;

Expand All @@ -193,7 +193,7 @@ async fn main() -> anyhow::Result<()> {
let mut engine = Engine::new(
world,
db.clone(),
&provider,
Arc::clone(&provider),
processors,
EngineConfig {
start_block: args.start_block,
Expand All @@ -217,7 +217,7 @@ async fn main() -> anyhow::Result<()> {

let mut libp2p_relay_server = torii_relay::server::Relay::new(
db,
provider.clone(),
Arc::clone(&provider),
args.relay_port,
args.relay_webrtc_port,
args.relay_websocket_port,
Expand Down
1 change: 1 addition & 0 deletions crates/torii/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ thiserror.workspace = true
tokio = { version = "1.32.0", features = [ "sync" ], default-features = true }
tokio-stream = "0.1.11"
tokio-util = "0.7.7"
tracing-test.workspace = true
tracing.workspace = true

[dev-dependencies]
Expand Down
Loading

0 comments on commit 8a10542

Please sign in to comment.