Commit 0e68258
Delay publishing the initial event until fully wired (#865)
* Delay publishing the initial event until fully wired
There's a race condition that can happen when we add the initial
request using onNext, that call will call flush while the downstream
subscriber is not yet set. To avoid this we just enqueue the initial
request, and wait till the upstream requests more input.
* Make spotless happy
* Avoid exposing the enqueueItem method to keep th Rx contract
* Update core/src/main/java/software/amazon/smithy/java/core/serde/event/EventStreamFrameEncodingProcessor.java
Co-authored-by: Adwait Kumar Singh <[email protected]>
* Avoid flushing twice if onError is called
---------
Co-authored-by: Adwait Kumar Singh <[email protected]>1 parent 8c69855 commit 0e68258
File tree
6 files changed
+58
-20
lines changed- aws/aws-event-streams
- src/main/java/software/amazon/smithy/java/aws/events
- core
- src/main/java/software/amazon/smithy/java/core/serde
- event
- http/http-binding/src/main/java/software/amazon/smithy/java/http/binding
6 files changed
+58
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 32 | + | |
36 | 33 | | |
37 | 34 | | |
38 | 35 | | |
| |||
62 | 59 | | |
63 | 60 | | |
64 | 61 | | |
65 | | - | |
| 62 | + | |
66 | 63 | | |
67 | 64 | | |
68 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
Lines changed: 34 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| 31 | + | |
30 | 32 | | |
31 | 33 | | |
32 | | - | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | | - | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | | - | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
76 | 94 | | |
77 | 95 | | |
78 | 96 | | |
79 | 97 | | |
80 | 98 | | |
81 | 99 | | |
82 | 100 | | |
83 | | - | |
| 101 | + | |
84 | 102 | | |
85 | 103 | | |
86 | 104 | | |
87 | 105 | | |
88 | 106 | | |
89 | 107 | | |
90 | 108 | | |
91 | | - | |
| 109 | + | |
92 | 110 | | |
93 | 111 | | |
94 | 112 | | |
| |||
107 | 125 | | |
108 | 126 | | |
109 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
110 | 132 | | |
111 | 133 | | |
112 | 134 | | |
| |||
126 | 148 | | |
127 | 149 | | |
128 | 150 | | |
129 | | - | |
130 | | - | |
| 151 | + | |
| 152 | + | |
131 | 153 | | |
132 | 154 | | |
133 | 155 | | |
| |||
184 | 206 | | |
185 | 207 | | |
186 | 208 | | |
187 | | - | |
| 209 | + | |
188 | 210 | | |
189 | | - | |
| 211 | + | |
190 | 212 | | |
191 | 213 | | |
192 | | - | |
| 214 | + | |
193 | 215 | | |
194 | 216 | | |
195 | 217 | | |
| |||
238 | 260 | | |
239 | 261 | | |
240 | 262 | | |
241 | | - | |
242 | | - | |
| 263 | + | |
| 264 | + | |
243 | 265 | | |
244 | 266 | | |
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
33 | | - | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
37 | 53 | | |
38 | 54 | | |
39 | 55 | | |
| |||
44 | 60 | | |
45 | 61 | | |
46 | 62 | | |
| 63 | + | |
47 | 64 | | |
48 | 65 | | |
49 | 66 | | |
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| 124 | + | |
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
| |||
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
154 | | - | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| |||
0 commit comments