add filter and ping

This commit is contained in:
callebtc
2023-02-01 15:10:20 +01:00
parent 1d6ee33aa4
commit 36768d3236
3 changed files with 37 additions and 30 deletions

View File

@@ -65,6 +65,12 @@ class Relay:
time.sleep(1)
self.connect(self.ssl_options)
def get_pint(self):
if self.connected:
return int(self.ws.last_ping_tm - self.ws.last_pong_tm)
else:
return 0
def publish(self, message: str):
if self.connected:
self.num_sent_events += 1