-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
chore(rpc): trait for blocking task #8538
Conversation
I don't get why this test doesn't work besides, it works locally :'( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change is problematic because it no longer treats CPU-bound and IO-bound tasks differently and spawns them in the pool of blocking tasks, which is a rayon wrapper intended only for tracing tasks that are predominantly CPU-bound
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, trait suggestion
Simplifies the interface for executing blocking code in
EthApi
.Removes semantically counterintuitive function for running a future on a blocking taskMovesEthApi::on_blocking_task
into trait methodSpawnBlocking::spawn_blocking_io
, which replaces less generalEthTransactions::spawn_blocking
. MovesEthApi::spawn_tracing_task_with
intoSpawnBlocking::spawn_tracing
, replacing less generalEthTransactions::spawn_blocking
.EthBlocks
andEthTransactions
EthApi::on_blocking_task
with calls toeth::api::SpawnBlocking::spawn_blocking_io
in impl ofEthApiServer
. Moves closer to goal of eventually having default trait method impls forEthApiServer
.