Conversation
|
RxJava-pull-requests #1441 SUCCESS |
|
RxJava-pull-requests #1442 SUCCESS |
|
RxJava-pull-requests #1443 SUCCESS |
|
RxJava-pull-requests #1445 SUCCESS |
There was a problem hiding this comment.
This can still just use getAndAdd without the CAS retry loop.
There was a problem hiding this comment.
Here I try to ignore the further requests after request(Long.MAX_VALUE). I cannot use getAndAdd because if requested == Long.MAX_VALUE, I wanna ignore n. If adding n to requested, and if it happens to execute in while (true) loop in emit method, the loop won't stop because requested < 0.
There was a problem hiding this comment.
For the overflow, I mean sending a request(n) after request(Long.MAX_VALUE) may make requested overflow easily. c+n is rarely overflow if request != Long.MAX_VALUE (However, we still can handle c+n overflow problem by adding a check c > Long.MAX_VALUE - n).
There was a problem hiding this comment.
If we keep the fast path we can just check that request is MAX_VALUE then skip. For example: https://github.com/Netflix/RxJava/blob/bb56093c00185dbd39785a95197abe4b66f3bbca/rxjava-core/src/main/java/rx/internal/operators/OnSubscribeRange.java#L59
|
RxJava-pull-requests #1450 FAILURE |
Signed-off-by: zsxwing <zsxwing@gmail.com>
|
RxJava-pull-requests #1453 SUCCESS |
|
I think this looks good, though I'm still curious if the complexity here is worth us having a fast-path. Would be interesting to do JMH testing. In |
TakeLastshould ignore otherrequests if it's requested withLong.MAX_VALUE. #1522