Question: How do we handle the Flux Generator when there are no more data?
I am using Project Reactor's Flux API to poll the data that are put in Redis (By external service). This needs to be indefinite poll until the service goes down/terminated/stopped.
I am using Flux Generator to fetch the data from Redis. There are cases where there will be no data available in Redis for some time and hence Generator will not be able to call onNext. But I want to resume when there will be data available in Redis.
How do I handle this situation? I see below options:
1) call onError
with custom exception stating that there are no data available at the time
2) call complete
to signal - In this case, i am periodically creating Flux instance and the same will be completed when there will not be any data.