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

Make receive backpressure clearer #1283

Closed
mwelzl opened this issue Sep 7, 2023 · 4 comments · Fixed by #1387
Closed

Make receive backpressure clearer #1283

mwelzl opened this issue Sep 7, 2023 · 4 comments · Fixed by #1387
Labels

Comments

@mwelzl
Copy link
Contributor

mwelzl commented Sep 7, 2023

From the review by Robert Wilton:

p 70, sec 9.3.2. Receive Events

  Each call to Receive will be paired with a single Receive event,
  which can be a success or an error.  This allows an application to
  provide backpressure to the transport stack when it is temporarily
  not ready to receive Messages.

The backpressure aspect wasn't entirely clear to me. So, if an application can
handle receiving multiple receive events at the same time, it can make multiple
calls to receive without waiting for, or processing, any receive events? Is
that how the application controls the backpressure?

Also:

How does the transport stack know that the application has finished with the
memory holding the message in the receive event, or is the expectation that the
receive message contents is logically always allocated on the heap and it is
responsibility of the receiver to free the memory once it is done with it?

@mwelzl mwelzl added the API label Sep 7, 2023
@mwelzl
Copy link
Contributor Author

mwelzl commented Sep 7, 2023

Clearly, the answer to his first question is "yes". I thought the text is clear enough, but we can just add a sentence, turning his question into an example, e.g.:

For example, if an application can handle receiving multiple receive events at the same time, it can make multiple
calls to receive without waiting for, or processing, any receive events.

About the second question, I think that, as in #1282, there are multiple ways to implement this concretely, and such memory management questions are beyond the scope of our abstract API. What do others think?

@mwelzl mwelzl assigned mwelzl and unassigned mwelzl Sep 7, 2023
@gorryfair
Copy link
Contributor

I think an example is good,( but the design is an implementation / style. The proposed wording still needs a little crafting: "For example, an application that receives multiple receive events can process..."

@gorryfair
Copy link
Contributor

Is /which can be a success or an error/which can return a success or an error/?

@mwelzl
Copy link
Contributor Author

mwelzl commented Sep 7, 2023

Maybe not: the event returns data, and it can, hm, contain an error? Also convey an error? Be an error event?

Seriously, let's just remove: "which can be a success or an error." - it's really not needed.

mwelzl added a commit that referenced this issue Sep 27, 2023
May become unnecessary though, depending on what we think of #1352.
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 a pull request may close this issue.

2 participants