rxjava-promises icon indicating copy to clipboard operation
rxjava-promises copied to clipboard

Wait for multiple promises?

Open fmaylinch opened this issue 9 years ago • 2 comments

Sorry if this issue is not appropriate, but I wonder if I can wait for multiple promises to be fulfilled.

I was checking https://github.com/jdeferred/jdeferred and it has that feature. I understand the specification is different (jdeferred doesn't let you chain promises, for example).

Thank you!

fmaylinch avatar Dec 23 '15 17:12 fmaylinch

Sorry this library doesn't support it as it was designed to be barebones and serve a single purpose - asynchronous return of a single value. The use case you describe is more suited to a utility library.

However, you could combine it with the underlying rxjava observable and use flatmap.

When I wrote this library rxjava was not very mature at that stage. Right now you can easily replace this with a PublishSubject. That is what I would recommend.

Regards, Daryl

On Thu, Dec 24, 2015 at 4:40 AM Ferran Maylinch [email protected] wrote:

Sorry if this issue is not appropriate, but I wonder if I can wait for multiple promises to be fulfilled

I was checking https://githubcom/jdeferred/jdeferred and it has that feature I understand the specification is different (it doesn't let you chain promises, for example)

Thank you!

— Reply to this email directly or view it on GitHub https://github.com/darylteo/rxjava-promises/issues/17.

darylteo avatar Dec 24 '15 00:12 darylteo

Hi Daryl,

I'm using RxJava (RxAndroid actually) as you suggested.

Thank you!​

fmaylinch avatar Dec 28 '15 10:12 fmaylinch