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

Incremental decoding for containers #171

Merged
merged 1 commit into from
Dec 28, 2021
Merged

Conversation

alexbiehl
Copy link
Contributor

@alexbiehl alexbiehl commented Dec 10, 2021

The default interface is meant to work with lazy I/O. Unfortunately lazy I/O is not always easily available.

This PR introduces new low-level primitives for decoding containers for which input can be fed incrementally without necessarily relying on lazy I/O. Yet, lazy I/O is still perfectly supported.

The idea is very similar to binaries Decoder. With the key difference that the Blocks structure interleaves producing of results and consuming more bytes. This allows us to feed more bytes incrementally - even if only coming from a lazy ByteString.

I am using this change in production to stream huge containers from S3 using Amazonka.

@alexbiehl alexbiehl force-pushed the main branch 4 times, most recently from e71c00c to e6c8228 Compare December 11, 2021 09:18
@alexbiehl alexbiehl changed the title Incremental decoding of raw blocks Incremental decoding for containers Dec 11, 2021
The default interface is meant to work with lazy I/O. Unfortunately
we lazy I/O is not always available.

This PR introduces a new low-level primitive for decoding the blocks
of container so that more input can be fed incrementally.
@AlexeyRaga AlexeyRaga merged commit cad7fd4 into haskell-works:main Dec 28, 2021
@alexbiehl alexbiehl deleted the main branch December 28, 2021 14:29
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.

2 participants