Skip to content

Commit 37a09db

Browse files
authored
Improve context propagation docstring (#209)
1 parent 153ee19 commit 37a09db

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

context_propagation/interceptor.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,16 @@ def context_from_header(
4747
class ContextPropagationInterceptor(
4848
temporalio.client.Interceptor, temporalio.worker.Interceptor
4949
):
50-
"""Interceptor that can serialize/deserialize contexts."""
50+
"""Interceptor that propagates a value through client, workflow and activity calls.
51+
52+
This interceptor implements methods `temporalio.client.Interceptor` and `temporalio.worker.Interceptor` so that
53+
54+
(1) a user ID key is taken from context by the client code and sent in a header field with outbound requests
55+
(2) workflows take this value from their task input, set it in context, and propagate it into the header field of
56+
their outbound calls
57+
(3) activities similarly take the value from their task input and set it in context so that it's available for their
58+
outbound calls
59+
"""
5160

5261
def __init__(
5362
self,

0 commit comments

Comments
 (0)