-
Notifications
You must be signed in to change notification settings - Fork 1
/
redisson-future-promise.drawio
426 lines (426 loc) · 48.4 KB
/
redisson-future-promise.drawio
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
<mxfile host="Electron" modified="2024-05-05T07:44:19.323Z" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/21.6.5 Chrome/114.0.5735.243 Electron/25.3.1 Safari/537.36" etag="qsabSjx7u3I7-9xiycqv" version="21.6.5" type="device">
<diagram name="第 1 页" id="fGAcmG3HbIGoeRMDndeL">
<mxGraphModel dx="1114" dy="879" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="fmt0hhtX_X798YNu3B2O-1" style="edgeStyle=entityRelationEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=1;exitDx=0;exitDy=0;entryX=1;entryY=0;entryDx=0;entryDy=0;fontSize=10;fontColor=#007FFF;shape=link;width=3;strokeColor=#00CC66;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-20" target="fmt0hhtX_X798YNu3B2O-25">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-2" value="<h1>Redisson Future<span style="font-weight: 400;">、</span>Promise模式(3.15.0)</h1><div>无论 Redisson Netty 的 RFuture/RPromise、Promise 还是 JDK&nbsp;CompletableFuture 都是基于观察者模式(注册监听、回调)。</div><p>前置知识:<br></p><ul><li>Netty Promise 模式</li><li>JDK1.8 CompletableFuture (Redisson Future整合了Netty Promise 和 CompletableFuture)</li></ul><p></p>" style="text;html=1;strokeColor=none;fillColor=none;spacing=5;spacingTop=-20;whiteSpace=wrap;overflow=hidden;rounded=0;" vertex="1" parent="1">
<mxGeometry x="40" y="19" width="760" height="161" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-3" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-4" target="fmt0hhtX_X798YNu3B2O-7">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-4" value="<font color="#000000">RPromiseTest#testRPromise()</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="40" y="200" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-5" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-7" target="fmt0hhtX_X798YNu3B2O-8">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-6" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=#007FFF;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-7" target="fmt0hhtX_X798YNu3B2O-12">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-7" value="<font color="#000000">promise = new RedissonPromise&lt;&gt;()</font><br><b>1 </b>基于事件通知获取异步结果" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="240" y="200" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-8" value="<div><font color="#000000">LISTENERS_FIELD = DefaultPromise.class.getDeclaredField("listeners");</font></div><div><font color="#000000">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LISTENERS_FIELD.setAccessible(true)<br>Promise&lt;T&gt; promise = ImmediateEventExecutor.INSTANCE.newPromise()<br></font></div><div>这里可以看出依赖Netty Promise模式,<b>RedissonPromise继承CompletableFuture同时包含Netty&nbsp;DefaultPromise对象引用</b>(事件处理器是ImmediateEventExecutor)</div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="480" y="182.5" width="360" height="75" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-9" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=#007FFF;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-12" target="fmt0hhtX_X798YNu3B2O-15">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-10" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-12" target="fmt0hhtX_X798YNu3B2O-34">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-11" value="lambda" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.75;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=8;fontColor=#007FFF;strokeColor=#007FFF;dashed=1;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-12" target="fmt0hhtX_X798YNu3B2O-95">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-12" value="<font color="#000000">promise.onComplete((res, e) -&gt; {...})</font><br><font color="#007fff">2 注册回调处理结果,res是正常时返回的结果,e是异常时返回的异常对象</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
<mxGeometry x="240" y="280" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-13" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=#007FFF;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-15" target="fmt0hhtX_X798YNu3B2O-18">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-14" value="<font color="#007fff">lambda</font>" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;fontSize=8;fontColor=#000000;strokeColor=#007FFF;dashed=1;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-15" target="fmt0hhtX_X798YNu3B2O-89">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-15" value="<font color="#000000">promise.addListener(f -&gt; {...})</font><br>f是GenericFutureListener实例" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="560" y="280" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-16" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=#007FFF;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-18" target="fmt0hhtX_X798YNu3B2O-19">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-17" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=#007FFF;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-18" target="fmt0hhtX_X798YNu3B2O-20">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-18" value="<font color="#000000">this.addListener0(listener)<br></font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="960" y="280" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-19" value="<div><font color="#000000">&nbsp; &nbsp; &nbsp; &nbsp; if (this.isDone()) {</font></div><div><font color="#000000">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; this.notifyListeners();</font></div><div><font color="#000000">&nbsp; &nbsp; &nbsp; &nbsp; }</font></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;align=left;" vertex="1" parent="1">
<mxGeometry x="960" y="360" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-20" value="<font color="#000000">DefaultPromise.java</font><br><font color="#000000">this.</font><b style="color: rgb(0 , 0 , 0)">listeners</b><font color="#000000"> = listener</font><br>依然是观察者模式,那就搜索下代码看哪里回调的listeners" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="1200" y="275" width="200" height="50" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-21" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=#007FFF;strokeColor=#000000;curved=1;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-25" target="fmt0hhtX_X798YNu3B2O-26">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-22" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;fontSize=10;fontColor=#007FFF;strokeColor=#000000;curved=1;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-25" target="fmt0hhtX_X798YNu3B2O-29">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="700" y="660" />
<mxPoint x="700" y="720" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-23" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=10;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-25" target="fmt0hhtX_X798YNu3B2O-30">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-24" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=10;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-25" target="fmt0hhtX_X798YNu3B2O-31">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-25" value="<font color="#000000">观察者模式触发回调的时机</font><br><font color="#007fff">搜索源码搜索到4种</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
<mxGeometry x="500" y="640" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-26" value="<font color="#000000">setSuccess(V result)</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="740" y="640" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-27" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=10;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-29" target="fmt0hhtX_X798YNu3B2O-39">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="820" y="750" />
<mxPoint x="600" y="750" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-28" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-29" target="fmt0hhtX_X798YNu3B2O-41">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-29" value="<font color="#000000">trySuccess(V result)</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
<mxGeometry x="740" y="700" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-30" value="<font color="#000000">setFailure(Throwable cause)</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="740" y="760" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-31" value="<font color="#000000">tryFailure(Throwable cause)</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="740" y="820" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-32" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-34" target="fmt0hhtX_X798YNu3B2O-35">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-33" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=8;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-34" target="fmt0hhtX_X798YNu3B2O-105">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-34" value="promise.syncUninterruptibly()<br><font color="#007fff">3 同步阻塞直到完成(写入结果值或SUCCESS)</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
<mxGeometry x="240" y="720" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-35" value="ret = promise.getNow()<br><font color="#007fff">5 读取DefaultPromise result结果</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#ffe6cc;strokeColor=#d79b00;" vertex="1" parent="1">
<mxGeometry x="240" y="800" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-36" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=10;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-37" target="fmt0hhtX_X798YNu3B2O-29">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="560" y="900" />
<mxPoint x="560" y="720" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-37" value="<font color="#000000">promise.trySuccess("success")</font><br><font color="#007fff">4 异步代码中业务成功后执行<br>将结果写入result字段,并通知所有监听器<br></font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
<mxGeometry x="240" y="880" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-38" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-39" target="fmt0hhtX_X798YNu3B2O-99">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-39" value="<font color="#000000">complete(result)</font><br>结果同时写入CompletableFuture的result字段" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="520" y="900" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-40" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-41" target="fmt0hhtX_X798YNu3B2O-43">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-41" value="<font color="#000000">this.setSuccess0(result)</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="940" y="700" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-42" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-43" target="fmt0hhtX_X798YNu3B2O-46">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-43" value="<font color="#000000">this.setValue0(result == null ? SUCCESS : result)</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="1140" y="700" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-44" value="Y" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#000000;strokeColor=#000000;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-46" target="fmt0hhtX_X798YNu3B2O-50">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1560" y="720" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-45" value="N" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;fontSize=8;fontColor=#000000;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-46" target="fmt0hhtX_X798YNu3B2O-47">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-46" value="<font style="font-size: 10px" color="#000000">CAS更新DefaultPromise result值 <br>从null -&gt; objResult 成功 或者 <br>从 UNCANCELLABLE -&gt; objResult 成功</font>" style="rhombus;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;rounded=1;" vertex="1" parent="1">
<mxGeometry x="1340" y="690" width="180" height="60" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-47" value="<font color="#000000">return false</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="1350" y="780" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-48" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=#000000;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-50" target="fmt0hhtX_X798YNu3B2O-52">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-49" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.25;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=8;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-50" target="fmt0hhtX_X798YNu3B2O-116">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-50" value="<div><font color="#000000">if (this.checkNotifyWaiters()) {</font></div><div><font color="#000000">&nbsp; &nbsp; this.<b>notifyListeners</b>();</font></div><div><font color="#000000">}<br>return true;</font></div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=left;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
<mxGeometry x="1560" y="690" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-51" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-52" target="fmt0hhtX_X798YNu3B2O-54">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-52" value="<font color="#000000">EventExecutor <b>executor</b> = this.executor()</font><br>即ImmediateEventExecutor" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;align=center;" vertex="1" parent="1">
<mxGeometry x="1760" y="700" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-53" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-54" target="fmt0hhtX_X798YNu3B2O-56">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-54" value="<font color="#000000">InternalThreadLocalMap threadLocals = InternalThreadLocalMap.get()</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;align=center;" vertex="1" parent="1">
<mxGeometry x="1760" y="760" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-55" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=10;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-56" target="fmt0hhtX_X798YNu3B2O-59">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-56" value="<font color="#000000">int stackDepth = threadLocals.futureListenerStackDepth()</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;align=center;" vertex="1" parent="1">
<mxGeometry x="1760" y="820" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-57" value="Y" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=8;fontColor=#000000;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-59" target="fmt0hhtX_X798YNu3B2O-61">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1960" y="910" as="sourcePoint" />
</mxGeometry>
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-58" value="N" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=8;fontColor=#000000;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-59" target="fmt0hhtX_X798YNu3B2O-69">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-59" value="<font style="font-size: 8px" color="#000000">stackDepth &lt; <br>MAX_LISTENER_STACK_DEPTH</font>" style="rhombus;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;rounded=1;" vertex="1" parent="1">
<mxGeometry x="1795" y="890" width="130" height="60" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-60" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#000000;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-61" target="fmt0hhtX_X798YNu3B2O-64">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-61" value="<font color="#000000">栈深度+1</font><br><font color="#cc0066">???</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;align=center;" vertex="1" parent="1">
<mxGeometry x="2000" y="900" width="80" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-62" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#000000;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-64" target="fmt0hhtX_X798YNu3B2O-66">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-63" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#000000;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-64" target="fmt0hhtX_X798YNu3B2O-72">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-64" value="<font color="#000000">this.notifyListenersNow()</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=center;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
<mxGeometry x="1970" y="960" width="140" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-65" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=1;entryY=0.75;entryDx=0;entryDy=0;fontSize=8;fontColor=#000000;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-66" target="fmt0hhtX_X798YNu3B2O-50">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="2040" y="1080" />
<mxPoint x="1740" y="1080" />
<mxPoint x="1740" y="735" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-66" value="<font color="#000000">栈深度-1</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;align=center;" vertex="1" parent="1">
<mxGeometry x="1970" y="1020" width="140" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-67" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=1;entryY=0.75;entryDx=0;entryDy=0;fontSize=8;fontColor=#000000;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-69" target="fmt0hhtX_X798YNu3B2O-50">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="1860" y="1210" />
<mxPoint x="1740" y="1210" />
<mxPoint x="1740" y="735" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-68" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-69" target="fmt0hhtX_X798YNu3B2O-96">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-69" value="<font color="#000000">safeExecute(executor, new Runnable() {...})</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=center;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
<mxGeometry x="1790" y="1160" width="140" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-70" value="Y" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=8;fontColor=#000000;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-72" target="fmt0hhtX_X798YNu3B2O-75">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-71" value="N" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=8;fontColor=#000000;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-72" target="fmt0hhtX_X798YNu3B2O-78">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-72" value="<font color="#000000">listeners instanceof DefaultFutureListeners</font>" style="rhombus;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;rounded=1;" vertex="1" parent="1">
<mxGeometry x="2160" y="940" width="120" height="80" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-73" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;fontSize=8;fontColor=#000000;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-75" target="fmt0hhtX_X798YNu3B2O-81">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="2400" y="1030" />
<mxPoint x="2320" y="1030" />
<mxPoint x="2320" y="1110" />
<mxPoint x="2220" y="1110" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-74" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-75" target="fmt0hhtX_X798YNu3B2O-97">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-75" value="<font color="#000000">this.notifyListeners0(<br>(DefaultFutureListeners)listeners)</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=center;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
<mxGeometry x="2320" y="960" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-76" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=8;fontColor=#000000;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-78" target="fmt0hhtX_X798YNu3B2O-81">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-77" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#CC0066;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-78" target="fmt0hhtX_X798YNu3B2O-84">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-78" value="<font color="#000000">notifyListener0(this, (GenericFutureListener)listeners)</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=center;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
<mxGeometry x="2140" y="1060" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-79" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;fontSize=8;fontColor=#000000;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-80" target="fmt0hhtX_X798YNu3B2O-72">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-80" value="<font color="#000000">synchronized 同步修改通知状态notifyingListeners</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;align=center;" vertex="1" parent="1">
<mxGeometry x="2140" y="900" width="160" height="20" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-81" value="<font color="#000000">synchronized 同步修改通知状态notifyingListeners</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;align=center;" vertex="1" parent="1">
<mxGeometry x="2140" y="1120" width="160" height="20" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-82" value="<font color="#007fff">这里有点窍门:<br>通过synchronized同步修改通知状态,然后再通过通知状态控制是否执行通知所有监听器,可以降低锁的粒度,提升并发性能</font>" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=8;fontColor=#000000;" vertex="1" parent="1">
<mxGeometry x="2140" y="840" width="160" height="60" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-83" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;fontSize=8;fontColor=#007FFF;strokeColor=#000000;entryX=0.75;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-84" target="fmt0hhtX_X798YNu3B2O-89">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1130" y="570" as="targetPoint" />
<Array as="points">
<mxPoint x="2520" y="1080" />
<mxPoint x="2520" y="340" />
<mxPoint x="700" y="340" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-84" value="l.operationComplete(future)<br><font color="#007fff">即前面注册的GenericFutureListener</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=center;" vertex="1" parent="1">
<mxGeometry x="2340" y="1060" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-85" value="Y" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=8;fontColor=#000000;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-87" target="fmt0hhtX_X798YNu3B2O-91">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-86" value="N" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;fontSize=8;fontColor=#000000;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-87" target="fmt0hhtX_X798YNu3B2O-94">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-87" value="<font color="#000000">!f.isSuccess()</font>" style="rhombus;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;rounded=1;" vertex="1" parent="1">
<mxGeometry x="780" y="400" width="80" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-88" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;fontSize=8;fontColor=#000000;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-89" target="fmt0hhtX_X798YNu3B2O-87">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-89" value="<font color="#000000">GenericFutureListener</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="580" y="400" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-90" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;fontSize=8;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-91" target="fmt0hhtX_X798YNu3B2O-95">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-91" value="<font color="#000000">action.accept(null, f.cause())</font><br>promise收到失败的结果" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="640" y="480" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-92" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;fontSize=8;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-94" target="fmt0hhtX_X798YNu3B2O-95">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="920" y="560" />
<mxPoint x="460" y="560" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-93" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-94" target="fmt0hhtX_X798YNu3B2O-102">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-94" value="<font color="#000000">action.accept((T) f.getNow(), null)</font><br>promise收到成功的结果" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="840" y="480" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-95" value="<font color="#000000">(res, e) -&gt; {...}</font><br><div>BiConsumer&lt;? super V, ? super Throwable&gt; action</div>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="380" y="400" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-96" value="<font color="#007fff">没走到,暂略</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=center;" vertex="1" parent="1">
<mxGeometry x="1970" y="1160" width="140" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-97" value="<span style="color: rgb(0 , 127 , 255)">没走到,暂略</span>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;align=center;" vertex="1" parent="1">
<mxGeometry x="2540" y="960" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-98" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-99" target="fmt0hhtX_X798YNu3B2O-101">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-99" value="<font color="#000000">completeValue(value)</font><br>Unsafe CAS 为result字段赋值" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="740" y="900" width="140" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-100" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-101" target="fmt0hhtX_X798YNu3B2O-113">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-101" value="<font color="#000000">postComplete()</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="740" y="960" width="140" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-102" value="<font color="#000000">result = this.result;<br>!(result instanceof DefaultPromise.CauseHolder) <br>&amp;&amp; result != SUCCESS &amp;&amp; result != UNCANCELLABLE ? result : null<br></font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="1040" y="470" width="220" height="60" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-103" value="DefaultPromise.java" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=8;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="1105" y="450" width="90" height="20" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-104" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-105" target="fmt0hhtX_X798YNu3B2O-109">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-105" value="<font color="#000000">promise.syncUninterruptibly()<br></font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="500" y="1080" width="140" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-106" value="RedissonPromise.java" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=8;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="530" y="1060" width="100" height="20" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-107" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-109" target="fmt0hhtX_X798YNu3B2O-110">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-108" value="" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-109" target="fmt0hhtX_X798YNu3B2O-112">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-109" value="<font color="#000000">this.awaitUninterruptibly()<br></font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="680" y="1080" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-110" value="<font color="#000000">this.rethrowIfFailed()<br></font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="680" y="1140" width="160" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-111" value="DefaultPromise.java" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=8;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="712" y="1060" width="90" height="20" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-112" value="<font color="#000000">this.awaitUninterruptibly()</font><br><font color="#007fff">this.wait() 阻塞等待,直到完成<br>完成的标志:<b>result != null &amp;&amp; result != UNCANCELLABLE</b></font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
<mxGeometry x="880" y="1075" width="160" height="50" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-113" value="没走到,暂略" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="920" y="960" width="120" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-114" value="CompletableFuture.java" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;fontSize=8;fontColor=#007FFF;" vertex="1" parent="1">
<mxGeometry x="750" y="880" width="100" height="20" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-115" value="this.waiters &gt; 0" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;fontSize=8;fontColor=#007FFF;strokeColor=#000000;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-116" target="fmt0hhtX_X798YNu3B2O-119">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-116" value="<font color="#000000">DefaultPromise#<b>checkNotifyWaiters</b>()</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;align=center;" vertex="1" parent="1">
<mxGeometry x="1760" y="640" width="200" height="40" as="geometry" />
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-117" style="edgeStyle=orthogonalEdgeStyle;curved=1;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;fontSize=8;fontColor=#007FFF;strokeColor=#007FFF;dashed=1;" edge="1" parent="1" source="fmt0hhtX_X798YNu3B2O-119" target="fmt0hhtX_X798YNu3B2O-112">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="2160" y="660" />
<mxPoint x="2160" y="880" />
<mxPoint x="1410" y="880" />
<mxPoint x="1410" y="1100" />
</Array>
</mxGeometry>
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-118" value="<font style="font-size: 12px">唤醒</font>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=8;fontColor=#007FFF;" vertex="1" connectable="0" parent="fmt0hhtX_X798YNu3B2O-117">
<mxGeometry x="0.9264" y="-1" relative="1" as="geometry">
<mxPoint as="offset" />
</mxGeometry>
</mxCell>
<mxCell id="fmt0hhtX_X798YNu3B2O-119" value="<font color="#000000">this.notifyAll()</font>" style="rounded=1;whiteSpace=wrap;html=1;fontSize=10;fontColor=#007FFF;align=center;" vertex="1" parent="1">
<mxGeometry x="2040" y="640" width="100" height="40" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>