2626
2727def _wrap_subscription (
2828 transport_layer : CommonTransport ,
29- subscription_call ,
30- channel ,
31- callback ,
32- * args ,
29+ subscription_call : Callable [..., int ] ,
30+ channel : str ,
31+ callback : Callable [..., Any ] ,
32+ * args : Any ,
3333 mangle_for_receiving : Callable [[dict [str , Any ]], dict [str , Any ]] | None = None ,
3434 allow_non_recipe_messages : bool = False ,
35- log_extender = None ,
36- ** kwargs ,
37- ):
35+ log_extender : Callable [[ str , Any ], AbstractContextManager [ Any ]] | None = None ,
36+ ** kwargs : Any ,
37+ ) -> int :
3838 """Internal method to create an intercepting function for incoming messages
3939 to interpret recipes. This function is then used to subscribe to a channel
4040 on the transport layer.
@@ -61,7 +61,7 @@ def _wrap_subscription(
6161 """
6262
6363 @functools .wraps (callback )
64- def unwrap_recipe (header , message : dict [str , Any ]):
64+ def unwrap_recipe (header : dict [ str , Any ], message : dict [str , Any ]) -> Any :
6565 """Unpack incoming messages when they are in a recipe format.
6666
6767 Other messages are passed through unmodified.
@@ -124,11 +124,11 @@ def wrap_subscribe(
124124 transport_layer : CommonTransport ,
125125 channel : str ,
126126 callback : Callable [[RecipeWrapper , dict , dict ], None ],
127- * args ,
127+ * args : Any ,
128128 allow_non_recipe_messages : Literal [False ] = False ,
129129 mangle_for_receiving : Callable [[Any ], Any ] | None = None ,
130130 log_extender : Callable [[str , Any ], AbstractContextManager [Any ]] | None = None ,
131- ** kwargs ,
131+ ** kwargs : Any ,
132132) -> int : ...
133133
134134
@@ -137,24 +137,24 @@ def wrap_subscribe(
137137 transport_layer : CommonTransport ,
138138 channel : str ,
139139 callback : Callable [[RecipeWrapper | None , dict , dict | bytes ], None ],
140- * args ,
140+ * args : Any ,
141141 allow_non_recipe_messages : Literal [True ],
142142 mangle_for_receiving : Callable [[Any ], Any ] | None = None ,
143143 log_extender : Callable [[str , Any ], AbstractContextManager [Any ]] | None = None ,
144- ** kwargs ,
144+ ** kwargs : Any ,
145145) -> int : ...
146146
147147
148148def wrap_subscribe (
149- transport_layer ,
150- channel ,
151- callback ,
152- * args ,
153- allow_non_recipe_messages = False ,
154- mangle_for_receiving = None ,
155- log_extender = None ,
156- ** kwargs ,
157- ):
149+ transport_layer : CommonTransport ,
150+ channel : str ,
151+ callback : Callable [..., Any ] ,
152+ * args : Any ,
153+ allow_non_recipe_messages : bool = False ,
154+ mangle_for_receiving : Callable [[ Any ], Any ] | None = None ,
155+ log_extender : Callable [[ str , Any ], AbstractContextManager [ Any ]] | None = None ,
156+ ** kwargs : Any ,
157+ ) -> int :
158158 """Listen to a queue on the transport layer, similar to the subscribe call in
159159 transport/common_transport.py. Intercept all incoming messages and parse
160160 for recipe information.
@@ -186,13 +186,13 @@ def wrap_subscribe(
186186
187187
188188def wrap_subscribe_broadcast (
189- transport_layer ,
190- channel ,
191- callback ,
192- * args ,
189+ transport_layer : CommonTransport ,
190+ channel : str ,
191+ callback : Callable [..., Any ] ,
192+ * args : Any ,
193193 mangle_for_receiving : Callable [[Any ], Any ] | None = None ,
194- ** kwargs ,
195- ):
194+ ** kwargs : Any ,
195+ ) -> int :
196196 """Listen to a topic on the transport layer, similar to the
197197 subscribe_broadcast call in transport/common_transport.py. Intercept all
198198 incoming messages and parse for recipe information.
0 commit comments