Giter Site home page Giter Site logo

Comments (4)

njr-11 avatar njr-11 commented on August 26, 2024

The ContextState.install/restore API from Reactive Contexts (linked above) worries me a bit because I could see it leading to the possibility of applications leaking context, but I don't think we need to go that far in order to enable what you are wanting to do. It ought to be possible to accomplish as much with just the ThreadContextProvider SPI. What you are describing seems very useful and I agree is a good integration point to provide, but I wonder if it would better be done as separate from the mp-concurrency spec in order to avoid coupling to a specific version of RxJavaHooks that might possibly change over time?

from microprofile-sandbox.

FroMage avatar FroMage commented on August 26, 2024

I don't think it's specifically related to install/restore because your proposal with begin/end is the exactly same (it uses different method names and intermediate types but serves exactly the same purpose and has no additional benefit nor drawback).

What this propagator SPI buys us is that:

  • We can have optional plugins for each propagator type
  • The mp-concurrency would load/set them up, so the user would be sure that context propagation is whole when loaded
  • It'd be as easy as including them in the classpath to get contexts propagated

But the spec should not depend on RxJava, nor mandate that SPI plugins for RxJava exist. Its implementation would take care of that.

from microprofile-sandbox.

njr-11 avatar njr-11 commented on August 26, 2024

Thanks for clarifying about the implementations, not the spec, providing the plugins. That makes much more sense. Can you elaborate more on the specifics, maybe by walking through an example of what mp-concurrency would define the propagator SPI as and how it would be implemented? When I looked at the RxJava link, it seems to already have a plugin point to the ServiceLoader, META-INF/services/io.reactiverse.reactivecontexts.core.ContextPropagator, that is defined by RxJava. So I assume the plugin would be an implementation of this RxJava interface (and utilizing ThreadContextProvider SPI) rather than of a propagator interface defined by mp-concurrency. I might be missing something here, but I don't see what change would be made to enable this other than calling this out/recommending it for implementations.

from microprofile-sandbox.

FroMage avatar FroMage commented on August 26, 2024

Moved to eclipse/microprofile-context-propagation#7

from microprofile-sandbox.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.