Client#
- class zonis.Client[source]#
Bases:
RouteHandler
- Parameters:
- register_class_instance_for_routes(instance, *routes) None #
Register a class instance for the given route.
When you turn a method on a class into an IPC route, you need to call this method with the instance of the class to use as well as the names of the routes for registration to work correctly.
- Parameters:
instance – The class instance the methods live on
routes – A list of strings representing the names of the IPC routes for this class.
- route(route_name: Optional[str] = None)#
Turn an async function into a valid IPC route.
- Parameters:
route_name (Optional[str]) – An optional name for this IPC route, defaults to the name of the function.
- Raises:
DuplicateRoute – A route with this name already exists
Notes
If this is a method on a class, you will also need to use the
register_class_instance_for_routes
method for this to work as an IPC route.