From 8860884a4c7d5053438927def4f93c94a2b1f6eb Mon Sep 17 00:00:00 2001 From: Gabriel Simmons Date: Wed, 19 Apr 2023 20:13:08 -0700 Subject: [PATCH] remove unused file --- papercast/subscribers/websocket_subscriber.py | 27 ------------------- 1 file changed, 27 deletions(-) delete mode 100644 papercast/subscribers/websocket_subscriber.py diff --git a/papercast/subscribers/websocket_subscriber.py b/papercast/subscribers/websocket_subscriber.py deleted file mode 100644 index 5c6301e..0000000 --- a/papercast/subscribers/websocket_subscriber.py +++ /dev/null @@ -1,27 +0,0 @@ -from papercast.base import BaseSubscriber -from abc import ABC, abstractmethod -from papercast.production import Production -from typing import AsyncIterable -from websockets.client import connect -import json - -class WebSocketSubscriber(BaseSubscriber): - def __init__(self, url) -> None: - super().__init__() - self.url = url - - def process(self, input: Production, *args, **kwargs) -> Production: # TODO: might not need this - return input - - # @abstractmethod - def process_message(self, message) -> Production: - # process the message and return a Production object - message = json.loads(message) - print(message) - return self.process(Production(**message)) - - async def subscribe(self) -> AsyncIterable[Production]: - async with connect(self.url) as socket: - print("connected") - async for message in socket: - yield self.process_message(message)