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

Test, example, API docs for AsyncStreamCDC #31

Closed
nlfiedler opened this issue Apr 20, 2023 · 5 comments · Fixed by #32
Closed

Test, example, API docs for AsyncStreamCDC #31

nlfiedler opened this issue Apr 20, 2023 · 5 comments · Fixed by #32

Comments

@nlfiedler
Copy link
Owner

The newly introduced AsyncStreamCDC needs unit tests, API documentation, and a working example. The first question is how to supply an appropriate AsyncRead to the chunker since tokio is not compatible.

@cdata
Copy link
Contributor

cdata commented Jul 12, 2023

Heya, I just noticed this ready-to-go AsyncStreamCDC implementation, but it's not in a release yet. Maybe I can help move it forward?

One observation I have is that there is a compatibility shim available for AsyncRead that covers both Tokio and Futures: https://crates.io/crates/async-compat

A separate but related observation is that Tokio implementations are trending in popularity, so it may make for a better default choice compared to Futures.

I would be willing to take a stab at writing some tests and documentation if you would consider compatibility via async-compat to be a suitable solution to the presented problem.

@nlfiedler
Copy link
Owner Author

Using async-compat seems to be a reasonable approach, I would welcome your help on this. Thanks.

@cdata
Copy link
Contributor

cdata commented Jul 13, 2023

I took a stab at it. I endedup including support for both tokio and futures, although tokio is the "default." It may be preferable to have no default at all and have async stream support be opt-in.

@nlfiedler
Copy link
Owner Author

I agree that pulling in other dependencies should be opt-in since this crate is still pretty small.

@cdata
Copy link
Contributor

cdata commented Jul 13, 2023

I updated the change to fix the doc example and also make async streaming opt-in.

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 a pull request may close this issue.

2 participants