-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
WIP: groundwork for request-based API #455
Conversation
...as discussed in capnproto#64. To avoid an extra copy we will have to rework ClientHook & possibly other low level APIs, but this will let us play with code generation and user-facing APIs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot I reviewed this a few days ago, and read through it again. But hey, at least I saw a thing I overlooked last time!
If this is "done" for you, then it LGTM. Happy to re-review later if you want to add more, of course. |
It could probably at least use some docs before we merge this piece. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to merge when ready (unless you want me to review the docs).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a thought: what happens if I call Send()
multiple times on the same request? Do we want to make it idempotent?
Good question. My instinct is that we should return an error here
indicating the double-call, as that seems like it's almost certainly a
mistake.
Quoting Louis Thibault (2023-03-01 11:45:57)
… @lthibault approved this pull request.
Just a thought: what happens if I call Send() multiple times on the
same request? Do we want to make it idempotent?
|
Then again, it might be useful in cases where you want to repeatedly make the same call? I wouldn't want to support this if it makes implementation overly complex, of course. I'm also fine with the simple approach of documenting behavior, e.g. "Callers MUST NOT call Send more than once." |
That gets weird since we store the releasefunc and future -- would we have a slice of them? seems not worth it. Checking for a double-call is easy, so we may as well; I'll do that. |
SGTM. 👍 |
Done. |
Per Louis's request
...as discussed in #64. To avoid an extra copy we will have to rework ClientHook & possibly other low level APIs, but this will let us play with code generation and user-facing APIs.