introduce a websocket handler interface

This commit is contained in:
Jakob Ketterl
2021-05-18 15:42:30 +02:00
parent 9baebf444d
commit 3e7eb09f3e
2 changed files with 21 additions and 4 deletions

View File

@@ -13,6 +13,7 @@ from owrx.property import PropertyStack, PropertyDeleted
from owrx.modes import Modes, DigitalMode
from owrx.config import Config
from owrx.waterfall import WaterfallOptions
from owrx.websocket import Handler
from queue import Queue, Full, Empty
from js8py import Js8Frame
from abc import ABC, ABCMeta, abstractmethod
@@ -26,7 +27,7 @@ logger = logging.getLogger(__name__)
PoisonPill = object()
class Client(ABC):
class Client(Handler, metaclass=ABCMeta):
def __init__(self, conn):
self.conn = conn
self.multithreadingQueue = Queue(100)
@@ -494,7 +495,7 @@ class MapConnection(OpenWebRxClient):
self.mp_send({"type": "update", "value": update})
class WebSocketMessageHandler(object):
class WebSocketMessageHandler(Handler):
def __init__(self):
self.handshake = None