mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 23:41:33 +00:00
Use ServerUplinkConnetor.broadcast() instead of local helper
This commit is contained in:
parent
381cd2b11e
commit
558e660268
@ -131,16 +131,9 @@ class BroadcastingEventHandler(EventHandlerBase, ABC):
|
|||||||
response = self.dispatch_handling(message)
|
response = self.dispatch_handling(message)
|
||||||
if response:
|
if response:
|
||||||
self.own_message_hashes.append(self.hash_message(response))
|
self.own_message_hashes.append(self.hash_message(response))
|
||||||
self.server_connector.send(self.make_broadcast_message(response))
|
self.server_connector.broadcast(response)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def hash_message(message):
|
def hash_message(message):
|
||||||
message_bytes = dumps(message, sort_keys=True).encode()
|
message_bytes = dumps(message, sort_keys=True).encode()
|
||||||
return md5(message_bytes).hexdigest()
|
return md5(message_bytes).hexdigest()
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def make_broadcast_message(message):
|
|
||||||
return {
|
|
||||||
'key': 'broadcast',
|
|
||||||
'data': message
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user