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

Support awaiting messages #710

Open
philpax opened this issue Aug 17, 2023 · 2 comments
Open

Support awaiting messages #710

philpax opened this issue Aug 17, 2023 · 2 comments
Labels
enhancement New feature or request topic:api API functionality, including both host and guest topic:packages Package and package semantics. Dependencies, definitions, etc.

Comments

@philpax
Copy link
Contributor

philpax commented Aug 17, 2023

At present, Messages require you to set up a subscription that lasts until you cancel it, which is not the most ergonomic for one-shot messages or for a back-and-forth protocol.

Instead, we should

  • offer the ability to one-shot subscribe to a message (this existed previously, but was removed for Reasons:tm:)
  • use the former to provide a nice async wrapper for awaiting messages:
let (source, value) = MyCoolMessage::receive().await;

(it feels to me that (value, source) is a better order, but (source, value) is consistent with subscribe)

Also relevant:

@philpax philpax added enhancement New feature or request topic:api API functionality, including both host and guest topic:packages Package and package semantics. Dependencies, definitions, etc. labels Aug 17, 2023
@chaosprint
Copy link
Contributor

Is this related to #665

@philpax
Copy link
Contributor Author

philpax commented Aug 17, 2023

Nah, this is more of an API detail about how you use messages than how the messages are sent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request topic:api API functionality, including both host and guest topic:packages Package and package semantics. Dependencies, definitions, etc.
Projects
None yet
Development

No branches or pull requests

2 participants