Infinite queries

Hi all,

Is there a way to get an infinite query using influxdb2 reactive client (

I need to start a stream that never ends and at every event, do an action in a thread in backgroud.

Is there a way to do this?

Thank you

Hello @vladbragoi,
Welcome! We don’t have an example for that, but I think it could be done by a repeat operator -
Does that help?
If you end up figuring it out, would you mind sharing your code here for other users? If not, let me know if I need to dig deeper.

I wrote something like this:

queryReactiveApi.query(queryString, "myOrg")
                        records -> { /* doSomethingWith(records)*/ },

but I was forced to instantiate an executor service in order to make the main thread waiting until the query was running. If you have any suggestion, i’d be happy to implement your solution.
Thank you