-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fix event_handler type `EventHandlerMeta` to `Type[EventHandlerDelegator]` for pycharm inspection - Add validate condition if event context configured well - Add type hint to store() and publish()
- Loading branch information
Showing
3 changed files
with
29 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from fastapi_event.base import BaseEvent | ||
from fastapi_event.handler import event_handler | ||
from fastapi_event.listener import EventListener | ||
from fastapi_event.middleware import EventHandlerMiddleware | ||
|
||
__all__ = [ | ||
"event_handler", | ||
"BaseEvent", | ||
"EventListener", | ||
"EventHandlerMiddleware", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
class InvalidEventTypeException(Exception): | ||
def __init__(self): | ||
super().__init__("event must inherit BaseEvent") | ||
super().__init__("Event must inherit BaseEvent") | ||
|
||
|
||
class InvalidParameterTypeException(Exception): | ||
def __init__(self): | ||
super().__init__("parameter must inherit BaseModel") | ||
super().__init__("Parameter must inherit BaseModel") | ||
|
||
|
||
class EmptyContextException(Exception): | ||
def __init__(self): | ||
super().__init__("Event context is empty. check if middleware configured well") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters