-
Notifications
You must be signed in to change notification settings - Fork 123
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
Allow reading and writing messages from sockets in async
mode
#313
Conversation
32924c6
to
e7f5997
Compare
When I read packed encoding in async mode in C++, I do it by reading the whole packed message into memory in advance, then parsing it (from memory) using the synchronous implementation. Similarly for writing, write to a buffer first. |
Okay, so presumably you propose to populate a If my analysis is right, isn't this a limitation of the API? Theoretically, async reading of packed messages seems possible (if, perhaps, somewhat slow). It's just the API that doesn't allow it? |
Yeah to be honest I've just never used packed encoding in an async stream with multiple messages. It does seem like the library is missing something there. |
e7f5997
to
e619bde
Compare
@LasseBlaauwbroek please rebase, otherwise it looks good. |
Bad git for not resolving these conflicts automatically. Rebased. |
e619bde
to
1ce01e4
Compare
Since capnproto#313 it is possible to read and write messages over a socket. This commit adds a small section for read and write in the quickstart.
Since capnproto#313 it is possible to read and write messages over a socket. This commit adds a small section for read and write in the quickstart.
* Update documentation to async code (#331) This commit updates the documentation to the latest changes added with pycapnp 2.0.0. * Remove non existing classes/functions from the reference documentation * Adapt the quickstart to the latest changes. Mainly to new rpc handling, that now exlusively is done through asyncio. * DOC: Add section about send and receive messages over a socket Since #313 it is possible to read and write messages over a socket. This commit adds a small section for read and write in the quickstart.
Resolves #298 (see also capnproto/capnproto#1542). Step towards #311.
This PR build on top of #310, only the last commit is relevant.
@kentonv I'd also like to implement
read_async_packed()
andwrite_async_packed()
if possible. But I don't see any obvious functions in the C++ implementation that make this possible. And I can find surprisingly little information from other people that may have tried this before. The most relevant I can find is https://groups.google.com/g/capnproto/c/X344P1vATsU/m/5qxvGtDvAQAJ How would you suggest this could be implemented? Or is there currently no way? Thanks.