- Notifications
You must be signed in to change notification settings - Fork1.6k
Commit9334a56
committed
Don't automatically start requesting on subscribe
Motivation:HandlerSubscriber automatically starts requests when callingonSubscribe.But when a publisher subscribes, RxJava automatically requests theSubscription if there are some pending requests.When such race condition happen, we end up with 2 threads (calling andevent loop) competing for requesting the Subscription. This results isout of order published messages.Modification:Make HandlerSubscriber#onSubscribe noop and actually delay it to afterPublisher has subscribed.Result:No more out of order messages.1 parent8c27b67 commit9334a56
File tree
1 file changed
+12
-0
lines changed- client/src/main/java/org/asynchttpclient/netty/request/body
1 file changed
+12
-0
lines changedLines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| |||
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
111 | 123 | | |
112 | 124 | | |
113 | 125 | | |
| |||
0 commit comments
Comments
(0)