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

Standardize response messages in token.lua #291

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dvinubius
Copy link
Contributor

Solves #290

Any response message is tagged with
["Response-For"] = <Name-Of-The-Action>
in order to be more easily matchable by the receiver of the response.

Any response message is tagged with 
`["Response-For"] = <Name-Of-The-Action>`
in order to be more easily matchable by the receiver of the response.
@hitwill
Copy link

hitwill commented Jul 11, 2024

#290 (comment)

@kprimice
Copy link
Contributor

Can't you use the built-in Pushed-For for that purpose? (it is the Message-Id that any message was pushed for)

@dvinubius
Copy link
Contributor Author

dvinubius commented Jul 15, 2024

@kprimice Pushed-For propagates in a longer message chain. If the Request-Type message is sent as a consequence of handling another message, then the Response-Type message that follows will have a Pushed-For with the ID of the initial message.

The proposed solution is more focused on a single request-response message exchange, regardless of the broader message handling context

@twilson63
Copy link
Collaborator

Any reason, not to use Reference and X-Reference

local response = Send({...}).receive()
-- process response?

or

Send({...}).onReply(function (msg)
  -- do stuff
 end)

This is currently in preview (Release Candidate) if you want to try

@twilson63 twilson63 added the hold label Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants