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

Support Tokio's AsyncSeek trait for downloaded blobs. #59

Open
maboesanman opened this issue Feb 20, 2025 · 2 comments
Open

Support Tokio's AsyncSeek trait for downloaded blobs. #59

maboesanman opened this issue Feb 20, 2025 · 2 comments

Comments

@maboesanman
Copy link

Currently Tokio's AsyncRead api is supported via the Reader struct
https://docs.rs/iroh-blobs/latest/iroh_blobs/rpc/client/blobs/struct.Reader.html

It would be useful for things like zip archive based blobs to be able to seek as well.

Possibly AsyncBufRead as well.

If there is a performance penalty, there could be different methods for returning AsyncRead and AsyncRead + AsyncSeek

@n0bot n0bot bot added this to iroh Feb 20, 2025
@rklaehn
Copy link
Collaborator

rklaehn commented Feb 21, 2025

Ah, now I get what you want. You just want a way to get a handle to the item downloaded by the store, that you can use either in sync land (Read/Seek) and in tokio flavoured async land (AsyncRead / AsyncSeek).

Yes, that is quite reasonable, and something we should definitely support. Unfortunately there are a lot of things in flux right now, so if we just hack it in we might lose a lot of work.

@rklaehn
Copy link
Collaborator

rklaehn commented Feb 21, 2025

Made an issue for this: #60

Let's have the discussion in there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants