From 11b664c9befc097ef49ac188cf28fa35d48a2a54 Mon Sep 17 00:00:00 2001 From: melvinkcx Date: Tue, 22 Nov 2022 22:59:34 +0900 Subject: [PATCH] add nullhandler --- fastapi_events/handlers/null.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 fastapi_events/handlers/null.py diff --git a/fastapi_events/handlers/null.py b/fastapi_events/handlers/null.py new file mode 100644 index 0000000..0711b21 --- /dev/null +++ b/fastapi_events/handlers/null.py @@ -0,0 +1,17 @@ +from typing import Iterable + +from fastapi_events.handlers.base import BaseEventHandler +from fastapi_events.typing import Event + + +class NullHandler(BaseEventHandler): + """ + NullHandler + a handler that does nothing. + can be used as a stub when a handler is expected. + """ + async def handle(self, event: Event) -> None: + ... + + async def handle_many(self, events: Iterable[Event]) -> None: + ...