platypush/backend/websocket/__init__.py
def notify_web_clients(self, event):
        """ Notify all the connected web clients (over websocket) of a new event """

        async def send_event(websocket):
            try:
                await websocket.send(str(event))
            except Exception as e:
                self.logger.warning('Error on websocket send_event: {}'.format(e))

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

        for ws in active_websockets:
            try:
                loop.run_until_complete(send_event(ws))
            except ConnectionClosed:
                self.logger.info('Client connection lost')
                self.active_websockets.remove(ws)
 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(websocket):
            try:
                await websocket.send(str(event))
            except Exception as e:
                self.logger.warning('Error on websocket send_event: {}'.format(e))
        loop = get_or_create_event_loop()
        active_websockets = self.active_websockets.copy()
        for ws in active_websockets:
            try:
                loop.run_until_complete(send_event(ws))
            except ConnectionClosed:
                self.logger.info('Client connection lost')
                self.active_websockets.remove(ws)
def notify_web_clients ( self , event ) : async def send_event ( websocket ) : try : await websocket . send ( str ( event ) ) except Exception as e : self . logger . warning ( 'Error on websocket send_event: {}' . format ( e ) ) loop = get_or_create_event_loop ( ) active_websockets = self . active_websockets . copy ( ) for ws in active_websockets : try : loop . run_until_complete ( send_event ( ws ) ) except ConnectionClosed : self . logger . info ( 'Client connection lost' ) self . active_websockets . remove ( ws )
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