I want to override my WebSocketClientFactory class to allow a job queue to be filled by the incoming data. Here's the connection code I am trying
factory = WebSocketClientFactory("ws://localhost:7096")
job_queue = Queue.Queue()
factory.protocol = BridgeSocket(job_queue)
connectWS(factory)
And here's my socket class:
class BridgeSocket(WebSocketClientProtocol):
def __init__(self,producer_queue):
self.producer_queue = producer_queue
def sendHello(self):
self.sendMessage("hello")
def onOpen(self):
self.sendHello()
.....
However I am getting error
exceptions.AttributeError: BridgeSocket instance has no __call__ method
Is there any way I can share queues between my main threads and the websockets I create within them.