You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Establishes the participant as a receiver for calls of the specified RPC method.
300
-
Will overwrite any existing callback for the same method.
300
+
Can be used either as a decorator or a regular method.
301
+
302
+
The handler will recieve one argument of type `RpcInvocationData` and should return a string response which will be forwarded back to the caller.
303
+
304
+
The handler may be synchronous or asynchronous.
305
+
306
+
If unable to respond within `response_timeout`, the caller will hang up and receive an error on their side.
307
+
308
+
You may raise errors of type `RpcError` in the handler, and they will be forwarded to the caller.
309
+
310
+
Other errors raised in your handler will be caught and forwarded to the caller as "1500 Application Error".
301
311
302
312
Args:
303
-
method (str): The name of the indicated RPC method
304
-
handler (Callable): Will be invoked when an RPC request for this method is received
313
+
method_name (str): The name of the indicated RPC method.
314
+
handler (Optional[Callable]): Handler to be invoked whenever an RPC request for this method is received. Omit this argument to use the decorator syntax.
305
315
306
316
Returns:
307
-
None
308
-
309
-
Raises:
310
-
RpcError: On failure. Details in `message`.
317
+
None (when used as a decorator it returns the decorator function)
0 commit comments