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

WIP: groundwork for request-based API #455

Merged
merged 5 commits into from
Mar 1, 2023
Merged

Conversation

zenhack
Copy link
Contributor

@zenhack zenhack commented Feb 18, 2023

...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.

@zenhack zenhack marked this pull request as draft February 18, 2023 03:10
...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.
request.go Show resolved Hide resolved
request.go Show resolved Hide resolved
Copy link
Collaborator

@lthibault lthibault left a 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!

request.go Outdated Show resolved Hide resolved
@lthibault
Copy link
Collaborator

If this is "done" for you, then it LGTM. Happy to re-review later if you want to add more, of course.

@zenhack
Copy link
Contributor Author

zenhack commented Feb 24, 2023

It could probably at least use some docs before we merge this piece.

lthibault
lthibault previously approved these changes Feb 28, 2023
Copy link
Collaborator

@lthibault lthibault left a 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).

@zenhack zenhack marked this pull request as ready for review March 1, 2023 05:57
@zenhack zenhack requested a review from lthibault March 1, 2023 05:57
lthibault
lthibault previously approved these changes Mar 1, 2023
Copy link
Collaborator

@lthibault lthibault left a 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?

@zenhack
Copy link
Contributor Author

zenhack commented Mar 1, 2023 via email

@lthibault
Copy link
Collaborator

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."

@zenhack
Copy link
Contributor Author

zenhack commented Mar 1, 2023

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.

@lthibault
Copy link
Collaborator

SGTM. 👍

@zenhack
Copy link
Contributor Author

zenhack commented Mar 1, 2023

Done.

request.go Outdated Show resolved Hide resolved
request.go Outdated Show resolved Hide resolved
Per Louis's request
@zenhack zenhack merged commit 63e839a into capnproto:main Mar 1, 2023
@zenhack zenhack deleted the request-api branch March 1, 2023 21:11
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