Commit a31886d
authored
Serialization context (#1102)
# Problem
We must make it possible for users to create custom data converters, the methods of which have access to relevant context. In other words, when implementing any of the above interfaces, the user must be able to implement methods that have access to a context object.
# Solution
1. At every point where the data converter is used, we construct a context-aware data converter by calling `data_converter._with_context(context)`.
2. Users take advantage of this by implementing `with_context` methods on any of the following components:
- payload converter
- failure converter
- payload codec
3. In addition, users may implement `with_context` on an `EncodingPayloadConverter`. These are used by the SDK’s default payload converter.
4. In addition, *we* provide a `with_context` method on `AsyncActivityHandle` that *they* can call their own activity context.
5. Add CommandAwarePayloadVisitor that sets command context when visiting payloads; use this for workflow activation decoding and encoding of the activation completion.1 parent 4a70f3d commit a31886d
File tree
16 files changed
+3058
-256
lines changed- .github/workflows
- scripts
- temporalio
- bridge
- worker
- workflow_sandbox
- tests
- worker
16 files changed
+3058
-256
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| 151 | + | |
| 152 | + | |
151 | 153 | | |
152 | 154 | | |
153 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
| 473 | + | |
473 | 474 | | |
474 | 475 | | |
475 | 476 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | | - | |
15 | 13 | | |
16 | 14 | | |
17 | 15 | | |
| |||
20 | 18 | | |
21 | 19 | | |
22 | 20 | | |
23 | | - | |
24 | 21 | | |
25 | 22 | | |
26 | 23 | | |
| |||
35 | 32 | | |
36 | 33 | | |
37 | 34 | | |
38 | | - | |
39 | | - | |
| 35 | + | |
| 36 | + | |
40 | 37 | | |
41 | 38 | | |
42 | 39 | | |
43 | 40 | | |
| 41 | + | |
44 | 42 | | |
45 | 43 | | |
46 | 44 | | |
| |||
299 | 297 | | |
300 | 298 | | |
301 | 299 | | |
302 | | - | |
| 300 | + | |
303 | 301 | | |
304 | 302 | | |
305 | 303 | | |
306 | | - | |
307 | | - | |
| 304 | + | |
| 305 | + | |
308 | 306 | | |
309 | | - | |
| 307 | + | |
310 | 308 | | |
311 | 309 | | |
312 | 310 | | |
313 | | - | |
| 311 | + | |
314 | 312 | | |
315 | 313 | | |
316 | 314 | | |
317 | | - | |
318 | | - | |
| 315 | + | |
| 316 | + | |
319 | 317 | | |
320 | | - | |
| 318 | + | |
0 commit comments