Skip to content

Comments

chore: store tokio::runtime::Handle in ethers/alloyDB#1557

Merged
rakita merged 5 commits intobluealloy:mainfrom
chirag-bgh:rt_handle
Jun 28, 2024
Merged

chore: store tokio::runtime::Handle in ethers/alloyDB#1557
rakita merged 5 commits intobluealloy:mainfrom
chirag-bgh:rt_handle

Conversation

@chirag-bgh
Copy link
Contributor

ref #1534

Copy link
Collaborator

@DaniPopes DaniPopes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you also return None if the runtime flavor is CurrentThread, and can you document it briefly in the fn new doc comments saying that it requires a tokio runtime?

otherwise looks good

@rakita rakita merged commit b40e4e3 into bluealloy:main Jun 28, 2024
@github-actions github-actions bot mentioned this pull request Jun 28, 2024
@wtdcode
Copy link
Contributor

wtdcode commented Jun 28, 2024

@rakita This change is not appropriate. If you wish to enforce ethersdb/alloydb to always play with async world, you should mark fn new as async fn new even not using any await in the function. This removes the check and also presents the correct signature.

@DaniPopes I disagree with not allowing ethersdb/alloydb to create current thread runtime. This makes them totally incompatible with sync world and creating a current thread runtime is rather cheap.

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

Successfully merging this pull request may close these issues.

5 participants