Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion context_propagation/interceptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,16 @@ def context_from_header(
class ContextPropagationInterceptor(
temporalio.client.Interceptor, temporalio.worker.Interceptor
):
"""Interceptor that can serialize/deserialize contexts."""
"""Interceptor that propagates a value through client, workflow and activity calls.

This interceptor implements methods `temporalio.client.Interceptor` and `temporalio.worker.Interceptor` so that

(1) a user ID key is taken from context by the client code and sent in a header field with outbound requests
(2) workflows take this value from their task input, set it in context, and propagate it into the header field of
their outbound calls
(3) activities similarly take the value from their task input and set it in context so that it's available for their
outbound calls
"""

def __init__(
self,
Expand Down
Loading