api: declare BaseAPI._message to be abstract
Now that all API providers are converted to use the high level dispatcher, make the implementation of that mandatory by declaring it an abstract method.
This commit is contained in:
parent
6f8b850ef2
commit
b2d406f941
1 changed files with 2 additions and 1 deletions
|
|
@ -27,7 +27,7 @@ class BaseAPI(abc.ABC):
|
|||
when the context is left.
|
||||
|
||||
New messages are delivered via the `_message` method, that
|
||||
is meant to be implemented by deriving classes.
|
||||
needs to be implemented by deriving classes.
|
||||
|
||||
Optionally, the `_cleanup` method can be implemented, to
|
||||
clean up resources after the context is left and the
|
||||
|
|
@ -50,6 +50,7 @@ class BaseAPI(abc.ABC):
|
|||
def endpoint(cls):
|
||||
"""The name of the API endpoint"""
|
||||
|
||||
@abc.abstractmethod
|
||||
def _message(self, msg: Dict, fds: jsoncomm.FdSet, sock: jsoncomm.Socket, addr: str):
|
||||
"""Called for a new incoming message"""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue