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 wasi:messaging/messaging-guest/handler take a channel parameter? #14

Open
dicej opened this issue Aug 15, 2023 · 7 comments
Open

Comments

@dicej
Copy link

dicej commented Aug 15, 2023

This would tell the guest which channel the message was received from and make it a more symmetric with wasi:messaging/producer/send, which takes a channel.

@dicej
Copy link
Author

dicej commented Aug 15, 2023

I'm also wondering if it should take a client parameter, in case the guest wants to use it e.g. to publish new messages to the same client it received the message from. That would save the trouble of opening a second handle.

@endocrimes
Copy link

I'm also wondering if it should take a client parameter, in case the guest wants to use it e.g. to publish new messages to the same client it received the message from. That would save the trouble of opening a second handle.

that would be nice for RPC-y pub-sub.

@thomastaylor312
Copy link
Collaborator

So for the channel part of this, that is part of the message itself and I think that is a fairly easy thing to consume. The passing a client parameter is interesting as it allows the caller to specify which client should be used to respond to something. I do find it a little awkward though for the use cases that don't need a client. I don't think constructing a client would be too much overhead as I figure most hosts would probably cache it, correct? So the first time might be a tiny bit of overhead depending on the underlying implementation, but after that it should be pretty quick

@dicej
Copy link
Author

dicej commented Mar 25, 2024

So for the channel part of this, that is part of the message itself and I think that is a fairly easy thing to consume.

Sorry, I'm not quite following this. Do you mean to say the channel should be part of the message type? E.g. a field to be added here?

@thomastaylor312
Copy link
Collaborator

Whoops sorry @dicej, I did do it in my open PR (which I am still doing some digging on around request/reply support): https://github.com/WebAssembly/wasi-messaging/pull/21/files#diff-a8f42ac7cc164b46639a30d22f97ca796bd47991da55edc0022578930424be06R29.

But it isn't on main yet

@thomastaylor312
Copy link
Collaborator

So in other words, I think it should be part of the message

@dicej
Copy link
Author

dicej commented Mar 25, 2024

Thanks for clarifying -- that works for me.

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