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

Find a way to « resume » an action #22

Open
Keruspe opened this issue Jul 8, 2019 · 2 comments
Open

Find a way to « resume » an action #22

Keruspe opened this issue Jul 8, 2019 · 2 comments

Comments

@Keruspe
Copy link
Collaborator

Keruspe commented Jul 8, 2019

Now that we accept any write, if we do something like pair(foo, bar) and hit e.g WouldBlock after writing foo, we are in a state where we already wrote foo, but not yet bar, and reusing the same combinator would write foo a second time.

@sdroege
Copy link
Contributor

sdroege commented Jul 8, 2019

Sounds like a job for generators, it would otherwise be relatively difficult (or a lot of effort) to manually add resumption points into the the serializers.

This is similar to nom requiring to parse everything again if not enough data was available (though not as bad there as here), which could be optimized with generators.

@Geal
Copy link
Collaborator

Geal commented Jul 11, 2019

my usual approach to async IO is to have buffers between the serializer and the socket, so it's not a very big issue. But it would be nice to have a combinator that can manage some state. I had something like this with the previous design idea based on futures

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

No branches or pull requests

3 participants