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

async BitswapStore trait #28

Closed

Conversation

chunningham
Copy link

It's common to have storage APIs which are async. This PR makes BitswapStore async in order to ease the integration of async storage backends. Is this acceptable or does it cause any issues aside from breaking the API?

@dvc94ch
Copy link
Member

dvc94ch commented Feb 4, 2022

Much care was taken to not have to make it async. Any reason in particular you think it should be async? DBS in general provide sync apis with an async flush. Are you using a networked db like postgres?

@chunningham
Copy link
Author

chunningham commented Feb 4, 2022

Are you using a networked db like postgres?

The plan is leave the door open to something like that, or for example SQLx. Is the problem that awaiting such an API might cause a glut of unprocessed events in the db thread?

@rkuhn
Copy link
Contributor

rkuhn commented Oct 12, 2022

Currently this bitswap implementation is the most primitive one, I’d call it MVP. Adding support for allocating more resources than a single thread to storage operations would be a larger change than making the DB interface async, and it would only benefit backends that can actually deliver parallelism.

Other than this, there is also libp2p/rust-libp2p#2632.

I’d say we close this issue here and have a discussion in rust-libp2p regarding how to best integrate a bitswap implementation. Once one emerges, I’m happy to hand over the crate name (if that should become relevant; although David needs to do the actual ownership change).

@rkuhn rkuhn closed this Oct 12, 2022
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.

3 participants