Router
Index
Methods
__call__
Invoke a request handler that matches the request label (or the default).
Parameters
optionalkeyword-onlycontext: TCrawlingContext
Returns None
__init__
Returns None
default_handler
A decorator used to register a default handler.
The default handler is invoked for requests that have either no label or a label for which we have no matching handler.
Parameters
optionalkeyword-onlyhandler: RequestHandler[TCrawlingContext]
Returns RequestHandler[TCrawlingContext]
handler
A decorator used to register a label-based handler.
The registered will be invoked only for requests with the exact same label.
Parameters
optionalkeyword-onlylabel: str
Returns Callable[[RequestHandler[TCrawlingContext]], None]
Dispatches requests to registered handlers based on their labels.