Commit db8902d
Dariusz Jędrzejczyk
Replay terminal signals to late subscribers in Flux.replay(int) and Flux.cache(int) (#3200)
Supporting the caching of only terminal signals in case of Flux.replay(int) and Flux.cache(int) operators.
As it currently stands, these operators, when provided 0 as the argument, resort to behaving like Flux.publish() which differs in the way termination signals are handled by the > 0 cases. This change still uses the FluxPublish class to implement the logic, however with a few minor changes to its implementation.
First of all, FluxPublish resets itself after source termination to be able to connect() again. FluxReplay on the other hand, does not reset itself in the case of only buffering signals without timeout. Therefore, for the behaviour of caching the terminals, FluxPublish does not reset itself and replays the terminal when it receives a late subscription.
For cases with expiry (TTL arguments), FluxReplay does indeed reset itself. Therefore, the behaviour for the time constrained values remains as before, using FluxPublish implementation for the 0 history case, but without caching terminals, while not honouring the TTL. This case can be later implemented if needed.
Fixes #31641 parent c85d2bd commit db8902d
File tree
4 files changed
+342
-96
lines changed- reactor-core/src
- main/java/reactor/core/publisher
- test/java/reactor/core/publisher
4 files changed
+342
-96
lines changedLines changed: 12 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7219 | 7219 | | |
7220 | 7220 | | |
7221 | 7221 | | |
7222 | | - | |
| 7222 | + | |
7223 | 7223 | | |
7224 | 7224 | | |
7225 | 7225 | | |
| |||
7565 | 7565 | | |
7566 | 7566 | | |
7567 | 7567 | | |
7568 | | - | |
| 7568 | + | |
7569 | 7569 | | |
7570 | 7570 | | |
7571 | 7571 | | |
| 7572 | + | |
| 7573 | + | |
7572 | 7574 | | |
7573 | 7575 | | |
7574 | 7576 | | |
| |||
7579 | 7581 | | |
7580 | 7582 | | |
7581 | 7583 | | |
7582 | | - | |
7583 | | - | |
| 7584 | + | |
| 7585 | + | |
7584 | 7586 | | |
7585 | 7587 | | |
7586 | 7588 | | |
| |||
7662 | 7664 | | |
7663 | 7665 | | |
7664 | 7666 | | |
7665 | | - | |
7666 | | - | |
| 7667 | + | |
| 7668 | + | |
7667 | 7669 | | |
7668 | 7670 | | |
7669 | 7671 | | |
| |||
7986 | 7988 | | |
7987 | 7989 | | |
7988 | 7990 | | |
7989 | | - | |
7990 | | - | |
| 7991 | + | |
| 7992 | + | |
| 7993 | + | |
| 7994 | + | |
7991 | 7995 | | |
7992 | 7996 | | |
7993 | 7997 | | |
| |||
Lines changed: 25 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
60 | 65 | | |
61 | 66 | | |
62 | 67 | | |
| |||
66 | 71 | | |
67 | 72 | | |
68 | 73 | | |
69 | | - | |
| 74 | + | |
| 75 | + | |
70 | 76 | | |
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
74 | 80 | | |
75 | 81 | | |
| 82 | + | |
76 | 83 | | |
77 | 84 | | |
78 | 85 | | |
| |||
111 | 118 | | |
112 | 119 | | |
113 | 120 | | |
114 | | - | |
| 121 | + | |
115 | 122 | | |
116 | 123 | | |
117 | 124 | | |
| |||
123 | 130 | | |
124 | 131 | | |
125 | 132 | | |
126 | | - | |
127 | | - | |
| 133 | + | |
128 | 134 | | |
129 | 135 | | |
130 | 136 | | |
131 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
132 | 145 | | |
133 | 146 | | |
134 | 147 | | |
| |||
515 | 528 | | |
516 | 529 | | |
517 | 530 | | |
518 | | - | |
519 | | - | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
520 | 535 | | |
521 | 536 | | |
522 | 537 | | |
523 | 538 | | |
524 | 539 | | |
525 | 540 | | |
526 | 541 | | |
527 | | - | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
528 | 545 | | |
529 | 546 | | |
530 | 547 | | |
| |||
Lines changed: 75 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
128 | 169 | | |
129 | 170 | | |
130 | 171 | | |
| |||
156 | 197 | | |
157 | 198 | | |
158 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
159 | 232 | | |
160 | 233 | | |
161 | 234 | | |
| |||
0 commit comments