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

Why do we allow directly querying schedulers, but require receivers to return a separate environment object? #286

Open
lewissbaker opened this issue Aug 13, 2024 · 0 comments

Comments

@lewissbaker
Copy link
Collaborator

The receiver concept has receivers provide access to a queryable object representing the execution environment by calling a get_env() member-function.

Similarly, the sender concept has callers get access to the sender's attributes by calling the get_env() member-function.

However, the scheduler concept is defined as implementing the queryable interface itself, rather than having a separate member-function that returns the queryable object.

This seems like an inconsistent API design - ideally we would use the same patterns for queryability here.

We should consider trying to make these consistent by, either:

  1. Adding a get_env() member-function to the scheduler concept which returns the scheduler's attributes/environment.
  2. Changing the sender and receiver concepts to just be directly queryable, and removing the get_env member-function/cpo.

Note that 2) was the original design before the environment was split out from the receiver to a separate object in an attempt to eliminate some recursive type-dependencies. However, we may need to go back to this design to address some limitations with this split which make it difficult to know whether a child operation's connect() is noexcept until you know the receiver type - something that is needed for computation of completion-signatures for some algorithms which currently only have access to the environment type, not the receiver type. See #247 and #246 for more details on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant