mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 19:01: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)
|
||||
if 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
|
||||
def hash_message(message):
|
||||
message_bytes = dumps(message, sort_keys=True).encode()
|
||||
return md5(message_bytes).hexdigest()
|
||||
|
||||
@staticmethod
|
||||
def make_broadcast_message(message):
|
||||
return {
|
||||
'key': 'broadcast',
|
||||
'data': message
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user