GitHub

Handlers

API reference for Handlers.

The handlers of group so far, needing R. GP and GE are what the group's middleware provides and fails with.

Attributes

AttributeTypeDescription
groupAnyGroup
entriesMapping[str, HandlerEntry] = field(default_factory=(dict[str, HandlerEntry]))

Functions

__init__

__init__(group, entries=dict[str, HandlerEntry]()) -> None
ParameterTypeDescription
groupAnyGroup
entriesMapping[str, HandlerEntry] = dict[str, HandlerEntry]()

handle

handle[P, Q, B, CB, H, S1, CS, E1](endpoint: HttpApiEndpoint[P, Q, B, CB, H, S1, CS, E1, Never], /, *, uninterruptible: bool = False) -> Bound[HttpApiRequest[P, Q, B, H], S1, E1 | GE, GP, GP, GE, R_co]
handle[P, Q, B, CB, H, S1, CS, E1, MP, ME, MR, MT](endpoint: HttpApiEndpoint[P, Q, B, CB, H, S1, CS, E1, HttpApiMiddleware[MP, ME, MR], MT], /, *, uninterruptible: bool = False) -> Bound[HttpApiRequest[P, Q, B, H], S1, E1 | ME | GE, MP | GP, GP, GE, R_co | MT | MR]

The slot of endpoint's handler; uninterruptible runs it uninterruptibly.

ParameterTypeDescription
endpoint
uninterruptible= False
@overload
def handle[P, Q, B, CB, H, S1, CS, E1](
    self,
    endpoint: HttpApiEndpoint[P, Q, B, CB, H, S1, CS, E1, Never],
    /,
    *,
    uninterruptible: bool = False,
) -> Bound[HttpApiRequest[P, Q, B, H], S1, E1 | GE, GP, GP, GE, R_co]: ...
@overload
def handle[P, Q, B, CB, H, S1, CS, E1, MP, ME, MR, MT](
    self,
    endpoint: HttpApiEndpoint[P, Q, B, CB, H, S1, CS, E1, HttpApiMiddleware[MP, ME, MR], MT],
    /,
    *,
    uninterruptible: bool = False,
) -> Bound[HttpApiRequest[P, Q, B, H], S1, E1 | ME | GE, MP | GP, GP, GE, R_co | MT | MR]: ...
def handle(self, endpoint: AnyEndpoint, /, *, uninterruptible: bool = False) -> Any:
    """The slot of ``endpoint``'s handler; ``uninterruptible`` runs it
    uninterruptibly."""
    return Bound[Any, Any, Any, Any, Any, Any, Any](self, endpoint, False, uninterruptible)

handle_raw

handle_raw[P, Q, B, CB, H, S1, CS, E1](endpoint: HttpApiEndpoint[P, Q, B, CB, H, S1, CS, E1, Never], /, *, uninterruptible: bool = False) -> Bound[HttpApiRequest[P, Q, None, H], S1, E1 | GE, GP, GP, GE, R_co]
handle_raw[P, Q, B, CB, H, S1, CS, E1, MP, ME, MR, MT](endpoint: HttpApiEndpoint[P, Q, B, CB, H, S1, CS, E1, HttpApiMiddleware[MP, ME, MR], MT], /, *, uninterruptible: bool = False) -> Bound[HttpApiRequest[P, Q, None, H], S1, E1 | ME | GE, MP | GP, GP, GE, R_co | MT | MR]

handle without reading the payload: the handler reads the request's body itself.

ParameterTypeDescription
endpoint
uninterruptible= False
@overload
def handle_raw[P, Q, B, CB, H, S1, CS, E1](
    self,
    endpoint: HttpApiEndpoint[P, Q, B, CB, H, S1, CS, E1, Never],
    /,
    *,
    uninterruptible: bool = False,
) -> Bound[HttpApiRequest[P, Q, None, H], S1, E1 | GE, GP, GP, GE, R_co]: ...
@overload
def handle_raw[P, Q, B, CB, H, S1, CS, E1, MP, ME, MR, MT](
    self,
    endpoint: HttpApiEndpoint[P, Q, B, CB, H, S1, CS, E1, HttpApiMiddleware[MP, ME, MR], MT],
    /,
    *,
    uninterruptible: bool = False,
) -> Bound[
    HttpApiRequest[P, Q, None, H], S1, E1 | ME | GE, MP | GP, GP, GE, R_co | MT | MR
]: ...
def handle_raw(self, endpoint: AnyEndpoint, /, *, uninterruptible: bool = False) -> Any:
    """``handle`` without reading the payload: the handler reads the
    request's body itself."""
    return Bound[Any, Any, Any, Any, Any, Any, Any](self, endpoint, True, uninterruptible)