peyk.dispatcher.middlewares.base

Base protocol for normalized-event dispatcher middleware.

Classes

BaseMiddleware(*args, **kwargs)

Awaitable middleware around dispatcher execution.

class peyk.dispatcher.middlewares.base.BaseMiddleware(*args, **kwargs)[source]

Bases: Protocol

Awaitable middleware around dispatcher execution.

Middleware receives the next callable, the normalized event, and a mutable context dictionary. It may add values to data before calling next; matching handlers receive those values as keyword arguments.