Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Adding Flow Subscriber APIs to ContextService #368

Merged
merged 3 commits into from
Nov 10, 2023
Merged

Conversation

mswatosh
Copy link
Member

@mswatosh mswatosh commented Nov 3, 2023

I'm looking to get feedback on adding these two new APIs to Context Service. After investigation the Flow classes added in Java 9, what I believe would be the most useful addition for Concurrency is providing context on the Flow.Subscriber methods. The new Flow class consists of:

  • Flow.Publisher
  • Flow.Subscription
  • Flow.Subscriber
  • Flow.Processor

From what I can tell, Flow.Publisher's methods would generally be invoked where context is available, and Flow.Subscription doesn't have methods where context would add value. Flow.Subscriber is where context could be useful, because it's methods may or may not be called asynchronously. Flow.Processor extends Flow.Publisher and Flow.Subscriber, which is why I provided an API to contextualize it's Flow.Subscriber methods.

Let me know your thoughts, or if there's something else we should be considering here.

Copy link
Contributor

@njr-11 njr-11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. I added a suggestion for a minor correction to working and a pointed out another minor item to think about.

Co-authored-by: Nathan Rauh <nathan.rauh@us.ibm.com>
@mswatosh mswatosh marked this pull request as ready for review November 8, 2023 14:30
@mswatosh mswatosh merged commit f6759ad into jakartaee:main Nov 10, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants