Commit c1fe951
authored
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 467be3e commit c1fe951
2 files changed
+50
-15
lines changed| 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 | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
177 | 183 | | |
178 | 184 | | |
179 | 185 | | |
| |||
319 | 325 | | |
320 | 326 | | |
321 | 327 | | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
322 | 339 | | |
323 | 340 | | |
324 | 341 | | |
| |||
1017 | 1034 | | |
1018 | 1035 | | |
1019 | 1036 | | |
1020 | | - | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
1021 | 1047 | | |
1022 | 1048 | | |
1023 | 1049 | | |
1024 | | - | |
| 1050 | + | |
1025 | 1051 | | |
1026 | 1052 | | |
1027 | 1053 | | |
1028 | | - | |
| 1054 | + | |
1029 | 1055 | | |
1030 | 1056 | | |
1031 | 1057 | | |
| 1058 | + | |
1032 | 1059 | | |
1033 | | - | |
1034 | 1060 | | |
1035 | 1061 | | |
1036 | 1062 | | |
| |||
1045 | 1071 | | |
1046 | 1072 | | |
1047 | 1073 | | |
1048 | | - | |
1049 | | - | |
1050 | | - | |
1051 | | - | |
| 1074 | + | |
1052 | 1075 | | |
1053 | 1076 | | |
1054 | 1077 | | |
| |||
1092 | 1115 | | |
1093 | 1116 | | |
1094 | 1117 | | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
1095 | 1124 | | |
1096 | 1125 | | |
1097 | 1126 | | |
| |||
0 commit comments