-
Notifications
You must be signed in to change notification settings - Fork 23
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
generic contextualizer methods to support reactive streams #180
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Nathan Rauh <[email protected]>
Thanks. What happens implementation-wise? I assume we can only proxy interface methods, so if we invoke Why do we have two methods? I fail to see the difference between them. @cescoffier any opinion? |
It should return the same type as the passed instance, or you will get a naked Reactive Streams Publisher. If you do this, the user will recreate another object from this one, which is not very convenient. Also, does it work with the |
It would proxy the interface that Flowable implements: Publisher. That means the subscribe method (the only one on the Publisher interface) would run with context.
It is an attempt to address the concern you raised under #166 (comment) , which I've copied here:
So we have one method to fit the generic pattern of subscriber where you want all interface methods of the supplied instance to run with context, and a second method that fits the particular pattern that you outline for publisher, where instead subscribed instances are auto-contextualized such that their interface methods run with context. Personally, I didn't yet see a strong case for this second pattern because it seemed more of a minor convenience, but tried to add it to address the concern.
This seems to contradict what was asked for under #166. I'm fine if plans have changed, in which case we should cancel #166 and get a new issue opened to represent whatever the real requirements are. It sounds like you are wanting MicroProfile Context Propagation to take an existing instance from an external implementation and mutate it such that context is propagated within it. We can't go that far, but maybe we can define some sort of mechanism by which other implementations can better plug into MicroProfile Context Propagation to get context propagated when they need it. In the new issue, can you elaborate more fully on what you are trying to achieve? |
pull fixes #166
This pull makes an attempt at addressing both of the scenarios for reactive streams from #166 in a generic manner that doesn't add reactive streams or Java 11 as compile dependencies to our spec classes.
Signed-off-by: Nathan Rauh [email protected]