From 90a6b1366afcd863fc6ce451a72ad24e7c1abd5a Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Tue, 15 Jul 2025 11:40:38 -0400 Subject: [PATCH] Improve context propagation docstring --- context_propagation/interceptor.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/context_propagation/interceptor.py b/context_propagation/interceptor.py index f8dca8e5..b9058548 100644 --- a/context_propagation/interceptor.py +++ b/context_propagation/interceptor.py @@ -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,