WebSocketClientFactory クラスをオーバーライドして、ジョブ キューが受信データで満たされるようにしたいと考えています。これが私が試している接続コードです
factory = WebSocketClientFactory("ws://localhost:7096")
job_queue = Queue.Queue()
factory.protocol = BridgeSocket(job_queue)
connectWS(factory)
そして、ここに私のソケットクラスがあります:
class BridgeSocket(WebSocketClientProtocol):
def __init__(self,producer_queue):
self.producer_queue = producer_queue
def sendHello(self):
self.sendMessage("hello")
def onOpen(self):
self.sendHello()
.....
しかし、私はエラーが発生しています
exceptions.AttributeError: BridgeSocket instance has no __call__ method
メイン スレッドとその中で作成した websocket の間でキューを共有する方法はありますか?