Skip to main content

Router

Dispatches requests to registered handlers based on their labels.

Index

Methods

__call__

  • async __call__(*, context): None
  • Invoke a request handler that matches the request label (or the default).


    Parameters

    Returns None

__init__

  • __init__(): None
  • Returns None

default_handler

handler

  • handler(*, label): Callable[[RequestHandler[TCrawlingContext]], None]
  • 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]