Skip to content

Commit

Permalink
fix: spawn build jobs as blocking tasks (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobkaufmann authored Jul 31, 2023
1 parent b5317b2 commit 75a29c2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ use reth_revm::{
EVM,
},
};
use tokio::sync::{broadcast, mpsc, oneshot};
use tokio::{
sync::{broadcast, mpsc, oneshot},
task,
};
use tokio_util::time::DelayQueue;

#[derive(Clone, Debug, Eq, PartialEq, Hash)]
Expand Down Expand Up @@ -341,7 +344,7 @@ where

let (tx, rx) = oneshot::channel();
let client = Arc::clone(&this.client);
tokio::spawn(async move {
task::spawn_blocking(move || {
// TODO: come back to this
Job::build(
config,
Expand Down Expand Up @@ -440,7 +443,7 @@ where
let config = self.config.clone();
let client = Arc::clone(&self.client);
let bundles = self.bundles.clone().into_iter();
tokio::spawn(async move {
task::spawn_blocking(move || {
Job::build(config, client, CachedReads::default(), bundles, tx);
});

Expand Down

0 comments on commit 75a29c2

Please sign in to comment.