reactphp / promise

Promises/A implementation for PHP.
https://reactphp.org/promise/
MIT License
2.38k stars 146 forks source link

allSettled operator #194

Closed andrei115 closed 3 years ago

andrei115 commented 3 years ago

In my use case I would want to have the functionality of the all() operator, but not have the promise rejected if one of the promises fails. I've seen in javascript the operator for this is called allSettled(). Is there anything similar that I could?

WyriHaximus commented 3 years ago

Should be possible, what would you do with the rejected promises? Just don't care about those?

andrei115 commented 3 years ago

found it, it's the GuzzleHttp\Promise\Utils::settle() method.

I had some messages from a message queue that needed processing. After completing the processing, I needed to inform the queue which messages were processed correctly so that it wouldn't deliver those messages anymore.