Skip to content

Commit

Permalink
hotifx/on_open
Browse files Browse the repository at this point in the history
dont call self.emit on_open event, may cause issues with a real internal bus

in hivemind context self.emit(Message("ovos.session.sync")) is not needed
  • Loading branch information
JarbasAl committed May 21, 2024
1 parent f8ca77e commit 911fb13
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions hivemind_bus_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,17 @@ def connect(self, bus=FakeBus(), protocol=None, site_id=None):
self.protocol.bind(bus)
self.wait_for_handshake()

def on_open(self, *args):
"""
Handle the "open" event from the websocket.
A Basic message with the name "open" is forwarded to the emitter.
"""
LOG.debug("Connected")
self.connected_event.set()
self.emitter.emit("open")
# Restore reconnect timer to 5 seconds on sucessful connect
self.retry = 5

def on_error(self, *args):
self.handshake_event.clear()
self.crypto_key = None
Expand Down

0 comments on commit 911fb13

Please sign in to comment.