platypush/backend/http/__init__.py
def notify_web_clients(self, event):
        """ Notify all the connected web clients (over websocket) of a new event """
        async def send_event(ws):
            try:
                self._acquire_websocket_lock(ws)
                await ws.send(str(event))
            except Exception as e:
                self.logger.warning('Error on websocket send_event: {}'.format(e))
            finally:
                self._release_websocket_lock(ws)

        loop = get_or_create_event_loop()
        wss = self.active_websockets.copy()

        for _ws in wss:
            try:
                loop.run_until_complete(send_event(_ws))
            except ConnectionClosed:
                self.logger.warning('Websocket client {} connection lost'.format(_ws.remote_address))
                self.active_websockets.remove(_ws)
                if _ws.remote_address in self._websocket_locks:
                    del self._websocket_locks[_ws.remote_address]
 Notify all the connected web clients (over websocket) of a new event 
Notify all the connected web clients (over websocket) of a new event
Notify all the connected web clients ( over websocket ) of a new event
def notify_web_clients(self, event):
        async def send_event(ws):
            try:
                self._acquire_websocket_lock(ws)
                await ws.send(str(event))
            except Exception as e:
                self.logger.warning('Error on websocket send_event: {}'.format(e))
            finally:
                self._release_websocket_lock(ws)
        loop = get_or_create_event_loop()
        wss = self.active_websockets.copy()
        for _ws in wss:
            try:
                loop.run_until_complete(send_event(_ws))
            except ConnectionClosed:
                self.logger.warning('Websocket client {} connection lost'.format(_ws.remote_address))
                self.active_websockets.remove(_ws)
                if _ws.remote_address in self._websocket_locks:
                    del self._websocket_locks[_ws.remote_address]
def notify_web_clients ( self , event ) : async def send_event ( ws ) : try : self . _acquire_websocket_lock ( ws ) await ws . send ( str ( event ) ) except Exception as e : self . logger . warning ( 'Error on websocket send_event: {}' . format ( e ) ) finally : self . _release_websocket_lock ( ws ) loop = get_or_create_event_loop ( ) wss = self . active_websockets . copy ( ) for _ws in wss : try : loop . run_until_complete ( send_event ( _ws ) ) except ConnectionClosed : self . logger . warning ( 'Websocket client {} connection lost' . format ( _ws . remote_address ) ) self . active_websockets . remove ( _ws ) if _ws . remote_address in self . _websocket_locks : del self . _websocket_locks [ _ws . remote_address ]
Notify all the connected web clients (over websocket) of a new event
Notify all the connected web clients ( over websocket ) of a new event
""" Notify all the connected web clients (over websocket) of a new event """
self
event