New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Promise#filter #302
Fix Promise#filter #302
Conversation
Hi @sadache, it looks OK to me but could you please check this? |
Yes, Ok for me too. But the pull request needs to be cleaned from the two other unrelated commits. This means we integrate only 9d69b11. |
Actually not so sure any more. |
So you want to leave the filter implementation as is (silently blocking? See the related ticket on the tracker)? This implementation is different than the one in scala 2.10. The same applies for collect. On 21 mai 2012, at 20:02, Sadek Drobi reply@reply.github.com wrote:
|
Nothing is blocking, but it never redeems. |
clean the pull request so that I can pull it before I change my mind |
Ok, I understand your points. There is a |
Implementation is here: https://github.com/scala/scala/blob/master/src/library/scala/concurrent/Future.scala#L524 |
The Future#either would return NoSuchElement if the first redeemed future is out of the filter (whereas the second could be satisfactory) |
Oh yes, you’re right… We could write a |
Won't work, I want to use error in worst case scenario (both promises return an error), ignoring NoSuchElement is wrong because it could happen from something else. |
#459
Promise#filter
so it never leads to an unredeemable promise ;Future#filter
behavior when the predicate fails: throw aNoSuchElementException
;STMPromise#collect
which was wrong and anyway not expose at thePromise
interface level.