Commit 24708f0
committed
refactor: subscribe: introduce
= introduces `buildPerEventExecutionContext` that creates an `ExecutionContext` for each subscribe event from the original `ExecutionContext` used to create the event stream
= `subscribe` now directly builds the `ExecutionContext` instead of relying on `createSourceEventStream`
= introduces `createSourceEventStreamImpl` and `executeImpl` functions that operate on the built `ExecutionContext` rather the `ExecutionArgs`
= `subscribe` calls the `createSourceEventStreamImpl` function on the original context and eventuallys calls `executeImpl` on the per event context created by `buildEventExecutionContext`.
Motivation:
1. remove unnecessary `buildExecutionContext` call, reducing duplicate work
2. paves the way for easily enhancing the `buildPerEventExecutionContext` to add a new `perEventContextFactory` argument to augment the context argument passed to resolvers as need per event.buildPerEventExecutionContext (#3639)1 parent add21f6 commit 24708f0
2 files changed
Lines changed: 50 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
192 | 198 | | |
193 | | - | |
194 | | - | |
| 199 | + | |
| 200 | + | |
195 | 201 | | |
196 | 202 | | |
197 | 203 | | |
| |||
394 | 400 | | |
395 | 401 | | |
396 | 402 | | |
397 | | - | |
| 403 | + | |
398 | 404 | | |
399 | 405 | | |
400 | 406 | | |
| |||
418 | 424 | | |
419 | 425 | | |
420 | 426 | | |
421 | | - | |
| 427 | + | |
422 | 428 | | |
423 | 429 | | |
424 | 430 | | |
| |||
441 | 447 | | |
442 | 448 | | |
443 | 449 | | |
444 | | - | |
| 450 | + | |
445 | 451 | | |
446 | 452 | | |
447 | 453 | | |
| |||
526 | 532 | | |
527 | 533 | | |
528 | 534 | | |
529 | | - | |
| 535 | + | |
530 | 536 | | |
531 | 537 | | |
532 | 538 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
221 | 227 | | |
222 | 228 | | |
223 | 229 | | |
| |||
364 | 370 | | |
365 | 371 | | |
366 | 372 | | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
367 | 384 | | |
368 | 385 | | |
369 | 386 | | |
| |||
1080 | 1097 | | |
1081 | 1098 | | |
1082 | 1099 | | |
1083 | | - | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
1084 | 1110 | | |
1085 | 1111 | | |
1086 | 1112 | | |
1087 | | - | |
| 1113 | + | |
1088 | 1114 | | |
1089 | 1115 | | |
1090 | 1116 | | |
1091 | | - | |
| 1117 | + | |
1092 | 1118 | | |
1093 | 1119 | | |
1094 | 1120 | | |
| 1121 | + | |
1095 | 1122 | | |
1096 | | - | |
1097 | 1123 | | |
1098 | 1124 | | |
1099 | 1125 | | |
| |||
1108 | 1134 | | |
1109 | 1135 | | |
1110 | 1136 | | |
1111 | | - | |
1112 | | - | |
1113 | | - | |
1114 | | - | |
| 1137 | + | |
1115 | 1138 | | |
1116 | 1139 | | |
1117 | 1140 | | |
| |||
1155 | 1178 | | |
1156 | 1179 | | |
1157 | 1180 | | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
1158 | 1187 | | |
1159 | 1188 | | |
1160 | 1189 | | |
| |||
0 commit comments