-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The interface was a bit inconsistent and loose. These refactors just tighten things up a bit. Signed-off-by: Daniel Bluhm <[email protected]>
- Loading branch information
Showing
9 changed files
with
86 additions
and
50 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
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
File renamed without changes.
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
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
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
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,25 +1,28 @@ | ||
"""Backend interface for SocketDock.""" | ||
|
||
from abc import ABC, abstractmethod | ||
from typing import Union | ||
from typing import Dict, Union | ||
|
||
|
||
class Backend(ABC): | ||
"""Backend interface for SocketDock.""" | ||
|
||
@abstractmethod | ||
async def socket_connected(self, callback_uris: dict): | ||
async def socket_connected( | ||
self, | ||
connection_id: str, | ||
headers: Dict[str, str], | ||
): | ||
"""Handle new socket connections, with calback provided.""" | ||
raise NotImplementedError() | ||
|
||
@abstractmethod | ||
async def inbound_socket_message( | ||
self, callback_uris: dict, message: Union[str, bytes] | ||
self, | ||
connection_id: str, | ||
message: Union[str, bytes], | ||
): | ||
"""Handle inbound socket message, with calback provided.""" | ||
raise NotImplementedError() | ||
|
||
@abstractmethod | ||
async def socket_disconnected(self, bundle: dict): | ||
async def socket_disconnected(self, connection_id: str): | ||
"""Handle socket disconnected.""" | ||
raise NotImplementedError() |
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
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