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

Store a tokio::runtime::Handle in alloy/ethers DB #1534

Open
DaniPopes opened this issue Jun 17, 2024 · 0 comments
Open

Store a tokio::runtime::Handle in alloy/ethers DB #1534

DaniPopes opened this issue Jun 17, 2024 · 0 comments

Comments

@DaniPopes
Copy link
Collaborator

DaniPopes commented Jun 17, 2024

Store an instance of tokio::runtime::Handle by calling Handle::try_current in the constructor instead of calling it on every RPC call.

This also removes the need to create a tokio runtime for every RPC call as well by always requiring a tokio handle to be present at instantiation.

The check for current-thread runtime should also be removed, because we don't want to spawn a runtime as above.

This change was also made in Foundry, see foundry-rs/foundry#7860

@DaniPopes DaniPopes changed the title Store a tokio::Handle in alloy/ethers DB Store a tokio::runtime::Handle in alloy/ethers DB Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant