0

What is the best way of packaging a RxJava operator as a Processor object?

I am writing some simple test cases for a MicroProfile Reactive Streams implementation in OpenLiberty.

I have RxJava on the classpath and want to explore packaging an RxJava operator as a Processor object that I can then imbed in my own framework's unit tests.

Similar to here: https://github.com/OpenLiberty/open-liberty/pull/6617/files#r259264238

I wanted to ask some more experienced RxJava programmers what the best option is?

Packaging up a 'missing' operator from one reactive streams framework and embedding it in another may seem an unusual thing to do but I have seen other sytems that have more than one framework (such as both reator and rxjava) in the mix and as a new framework we currently have a basic set of operators built in. So it might interesting to get an opinion from experience rather than me hacking up a Heath Robinson contraption.

Gordon.

  • Best option: not doing it. RxJava is a fully Reactive-Streams compliant implementation. Every Flowable is a `Publisher` and we have specific Processor implementations as well. Use them directly where you need a `Publisher`/`Processor`. Use composition. – akarnokd Feb 22 '19 at 13:58
  • I recognize your tecnical authority on RxJava @akarnokd :-) but that option is not really on the table for me. I need to write an example which bundles an RxJava operator into a reactive streams .org Processor. I am happy to write about the drawbacks of the approach on the comments :-). – Gordon Hutchison Feb 26 '19 at 16:04
  • If you don't need help, I'm fine with it. – akarnokd Feb 26 '19 at 20:25
  • I am genuinely sorry @akarnokd if I gave that impression or any sort of offence at all. I just have a list of things to do for my job and one of them is 'show the export of an RxJava operator by turning it into a reactive streams Processor' and I was unsure of the best way to do it after some initial research. Basically when I compose operators onto Processors (the ones I have found so far) I end up with Flowables which are Publishers not Processors (apologies for stating RxJava things to you - just expressing my problem) – Gordon Hutchison Feb 27 '19 at 16:32

0 Answers0