-
Notifications
You must be signed in to change notification settings - Fork 755
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
4.x: Intercepting the chaining of operators #540
Comments
My only real points would be:
|
BackgroundThe design of Essentially, it worked by decorating each operator in each reactive query expression using an
where The
The operator topology was inferred for visualization purposes by means of handling the UsageI know of a few places where this functionality has been used. RxSpy was mentioned before on this thread and seems to be the right approach for a reactive debugger going forward. Internally over here, I can think of two efforts that have directly depended on this functionality for diagnostics and throttling (detecting hot nodes in query operator graphs and providing alerts or taking actions), but I'm not sure about these state of those and will try to find out. Also, in earlier days, So, I think it'd be unfortunate to get rid of this functionality altogether, and AdviceI think it'd be worth for motivated community members to revamp this effort :-). I'm not sure if @niik would still be interested in his work, possibly bringing this project to the .NET Foundation as a tool that goes right with Rx. In fact, in a bigger scope for tooling-related projects, it wouldn't be a bad thing for Rx to include Roslyn analyzers to provide refactorings (e.g. on an event, provide a Though I'm biased towards the original design, I do believe that I'm also not sure I buy in to the performance argument, given that these are high-level control plane operations that only run during composition of query operators. That is, they don't run for |
I'd be delighted to see RxSpy evolve alongside with the ecosystem. I firmly believe that visualisation, debugging, and intelligent analysis of reactive flows is indispensable when working with large scale reactive applications and I think it would be a bummer if the ability to innovate in that space would diminish. I wrote RxSpy to explore what reactive analysis tooling could look like. In hindsight it was clear that live analysis, while being an excellent tool for teaching Rx, and one I used several times to explain the concepts, was likely not going to be as powerful as sampling, replaying and analysing flows after the fact. I started toying with that in niik/RxSpy#25 but never completed it. That said I'm afraid my work has lead me down other paths and I haven't been able to keep up with Rx for quite some time now. While I'd be glad to help I'm afraid my bandwidth is quite constrained these days. |
I took the work @niik had done and adjusted it to work on Android, not for visualization per se, but to get better diagnostics when things didn't work. See https://github.com/VistianOpenSource/Vistian.Reactive.Proxy . |
Cool, thanks for chiming in @niik and @VistianOpenSource. I think it's pretty clear that this mechanism is something we should keep and build on going forward. The main difference for implementation techniques on newer .NET platforms may be the lack of transparent proxy stuff, but it'd be fairly trivial to auto-generate an interceptor We'll keep this issue as a coat hanger for future discussions. |
Looks like the current setup is here to stay ever since. Closing. |
There is a plan to inline the
IQueryLanguage
interface andQueryLanguage
class into theObservable
static class (See #526 & #539) to save on an indirection and interface lookup. TheIQueryLanguage
has been always internal so in theory, nothing should depend on it or the original indirection.In practice though, looks like there exist tools such as RxSpy that seem to latch onto this feature so that the original
s_impl
in every operator could be overridden via a proxy implementation of theIQueryLanguage
interface. Obviously, ifs_impl
is no longer used, this and other similar tools will break.I'm convinced that the performance benefit of the inlining is quite worth it, but supporting external diagnostic options is also considerable feature requirement.
I can think of two approaches that could re-enable the overriding of the standard implementations, but there are caveats.
1. Keep the
IQueryLanguage
interfaceThe
IQueryLanguage
interface is retained an implementation can be inserted globally that takes precedence. Example (viaIQueryLanguageEx
for brevity):Concerns:
IQueryObservable
interface and there is no way to delegate back to the standard implementation publicly.2. Use type-specific operator-assembly hooks
The alternative, that RxJava also uses is to define function hooks that get called before an implementation is returned, allowing insertion of custom logic and/or complete replacement:
Concerns:
QueryLanguageHooks<int>.Hook = intobs -> intobs;
Observable
inside theFunc
may lead to an infinite recursion.(None of these is an issue with RxJava because Java currently only supports class-based generics so one can define an
Observable<Object>
hook only, the default implementations are semi-publicly available and finally there is a Java security manager infrastructure that can limit accesses so we don't have to deal with that at all.)3. Keep both
IQueryLanguage
&QueryLanguage
but do the override approachEstablish a static path via
QueryLanguage.SomeMethod()
instead ofs_impl.Create
:The text was updated successfully, but these errors were encountered: