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

Should outgoing-handler::handle consume its parameter? #39

Open
dicej opened this issue Jun 8, 2023 · 1 comment
Open

Should outgoing-handler::handle consume its parameter? #39

dicej opened this issue Jun 8, 2023 · 1 comment

Comments

@dicej
Copy link
Collaborator

dicej commented Jun 8, 2023

Should outgoing-handler::handle consume its outgoing-request parameter such that it can't be sent again, or should it be possible for an application to create a single request and send it multiple times?

@dicej dicej changed the title Should outgoing-request-write consume its parameter? Should outgoing-handler::handle consume its parameter? Jun 8, 2023
@lukewagner
Copy link
Member

Roughly yes, but I think the way this concretely manifests is that if you call consume (or write) more than once on the same request/response, it returns a failure. However, as long as we have a single handle type, there's nothing stopping a component from receiving a request via call to its exported handle, consumeing this request, and then passing the same request to an imported handle function, thereby giving the callee a request that will fail when consumed the first time the callee tries to call it. If the callee is the host, the host would thus return a failure from handle. This breaks a logical contract, but, until we add back a handle representing exclusive ownership, we don't have a way to express/enforce this in Wit.

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

2 participants