Questions tagged [reactive-streams]

a standard for asynchronous stream processing with non-blocking back pressure on the JVM

Reactive Streams is an initiative to provide a standard for asynchronous stream processing with non-blocking back pressure on the JVM.

http://www.reactive-streams.org/

358 questions
2
votes
1 answer

How do I subscribe to a reactive streams implementation running on a different JVM?

Let's assume we have two Akka Stream flows, each running on its own JVM. // A reactive streams publisher running on JVM 1: val stringPublisher: Publisher[String] = Source(() => "Lorem Ipsum".split("\\s").iterator).runWith(Sink.publisher[String]) //…
Ruurtjan Pul
  • 1,197
  • 1
  • 10
  • 21
2
votes
1 answer

Testing Akka Reactive Streams

I'm testing code which streams messages over an outgoing stream TCP connection obtained via: (IO(StreamTcp) ? StreamTcp.Connect(settings, address)) .mapTo[StreamTcp.OutgoingTcpConnection] .map(_.outputStream) In my tests, I substitute the resulting…
pkinsky
  • 1,718
  • 2
  • 23
  • 28
2
votes
1 answer

Iteratees Error/Exception Handling vs Reactive Streams/akka-stream

Surprise surprise I'm having a few problems with Iteratees and Error handling. The problem; Read some bytes from an InputStream (from the network, must be InputStream), do some chunking/grouing on this InputStream (for work distribution), followed…
NightWolf
  • 7,694
  • 9
  • 74
  • 121
1
vote
1 answer

Mono.just() is still blocking in my use case when the emitted element is pending

I have two test that use sleep() to simulate an api call which takes time to process, and test if Mono.just() make it non-blocking. In my first test, I emitted a String directly, but made it blocking in map(). @Test public void testMono()…
Rionash
  • 29
  • 3
1
vote
0 answers

RxJava how to intersperse a Flowable?

I'm new to rx-java, I'm comming from the akka world. In akka-streams there is a convinient intersperse function and I would like to know how to do the same on Flowable? so something like Flowable .fromIterable(List("foo","bar")) .intersperse("[",…
1
vote
2 answers

While fetching 4000 or more values from a database (postgresql) it is not possible to filter the elements. (using Reactive streams)

It is necessary to filter the flow of values from the database (filtering must be performed in a reactive, non-blocking style). You need to get the incoming element, take the email field from it and validate this value. After the first correct…
skyho
  • 1,438
  • 2
  • 20
  • 47
1
vote
1 answer

Check if Document in MongoDB exists, using reactive-streams

I'm trying to check if a document already exits, but I'm having some problems. I tried different solutions: Using findOne() and checking if output is null (doesn’t work) Using countDocument() (doesn’t work) The error that is saw the most is that I…
Jackolix
  • 23
  • 5
1
vote
1 answer

Mutiny - Propagate completion to parent multi / polling

I am writing a little polling mechanism using Mutiny, part of me learning the library and i am kinda stuck in cancelling the polling when result is found. I tried using the tick() and what i came up with looks…
1
vote
1 answer

How to create buffers of latest message for each id of group-by with project reactor?

I have a stream in which I'm grouping it by id (to be able to process different ids in parallel but within the same id, by order). I'd like to write to MongoDB with batches that contain each message per id only once (to make sure that each batch…
1
vote
2 answers

How to transform observable based on predicate involving first element

I'm trying to create an Rx.NET operator that takes an Observable and: Forwards each element unchanged if the first element is "a" Emits just a completion signal otherwise For example: -a-b-c-d-|- --> -a-b-c-d-|- -b-c-d-|- --> -|- How…
jack
  • 147
  • 1
  • 7
1
vote
1 answer

How to log error to DB and resume execution in project reactor?

I want to log an error to a mongo db collection and continue with the error propagation in the pipeline. How can I do that in project reactor? Current code makes use of an extractor(Mono.block()), which to my knowledge, is not advised to use. This…
1
vote
2 answers

How to multicast a Mono to multiple subscribers in Project Reactor?

With what I have read so far, one can multicast a Flux to multiple subscribers using ConnectableFlux using something similar to following: Flux integerFlux = Flux.range(1, 50) .log(); ConnectableFlux
1
vote
1 answer

Why does Mono.doOnError prints error logs

I have a functionality to store data to a couchbase array. I am using the reactive collection in couchbase 3.0 sdk. With the below sample I am able to store the data, but I am getting CasMismatchException printed in the logs. But as it is an…
1
vote
0 answers

LiveDataReactiveStreams.fromPublisher() not working with Single

I am getting User from Room Database by returning Single. Once I get the data I want to show it through LiveData observing, and I am using LiveDataReactiveStreams.fromPublisher() method, but looks like when .setValue() is called, all…
1
vote
1 answer

Emitting from Flux until one of conditions are met?

I am given an InputStream which is representing a resources (most probably a .txt file) and my assignment is to parse lines of that file. I have to make my program as modifiable as possible, meaning that today I'm reading from a file, but tomorrow…