Skip to content

Add globalTimeout operation on Flowable.#6383

Closed
newkek wants to merge 1 commit into
ReactiveX:2.xfrom
newkek:2.x-global-timeout
Closed

Add globalTimeout operation on Flowable.#6383
newkek wants to merge 1 commit into
ReactiveX:2.xfrom
newkek:2.x-global-timeout

Conversation

@newkek

@newkek newkek commented Jan 24, 2019

Copy link
Copy Markdown

Hi,

While working on a project where we needed to set a finite timeout bound to a flowable and error out if the timeout was reached, I wasn't able to find an operation that would be able to do that in the Flowable class. Only .timeout() is available but it is to specify a timeout between each item, not the global Flowable.

After some help from the mailing list I ended up using originalFlowable.takeUntil(Flowable.never().timeout()) which works very well for the intended purpose (shout-out to David from the mailing list who came up with it).
I think it would be valuable to other users who aren't aware of the takeUntil(Publisher) method, to have this operation available in the library. Please let me know if you think it would be useful as well.

I've included a simple unit test as well as Javadocs as best as I could, however I didn't know how to generate a marble schema...

Thanks.

@akarnokd

Copy link
Copy Markdown
Member

shout-out to David from the mailing list who came up with it

And the same David will close this PR for two reasons: 1) the functionality can be achieved with a small set of existing operators, and 2) please open an issue to discuss feature requests first so that time is not wasted on either end.

@akarnokd akarnokd closed this Jan 24, 2019
@akarnokd akarnokd added the 2.x label Jan 24, 2019
@newkek

newkek commented Jan 24, 2019

Copy link
Copy Markdown
Author

Ha - didn't realize @akarnokd was the David from the ML... 🤦‍♂️

Fair enough, although I thought this would be ok considering I've seen other methods in the Flowable class that are simple shortcuts to other operations, example: Flowable.merge(), Flowable.mergeArray(), startWith(), etc.. does that make sense?

Thanks for the quick reply. On both the ML and here.

@newkek newkek deleted the 2.x-global-timeout branch June 15, 2020 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants