def run(self) -> None:
    '\n        Start the event loop and run forever.\n        '
    log.debug('Running Websocket server')
    self.loop = asyncio.new_event_loop()
    asyncio.set_event_loop(self.loop)
    try:
        server_start = websockets.serve(self.handler, '127.0.0.1', WEBSOCKET_PORT, close_timeout=1)
        self.server = self.loop.run_until_complete(server_start)
        self.server_is_started.set()
        self.loop.run_forever()
    except OSError:
        log.exception('Server could not be started')
    finally:
        log.debug('loop stopped')
        log.debug('Pending tasks at close: %r', all_tasks(self.loop))
        self.loop.close()
        log.debug('loop closed')
        self.loop_is_closed.set()
Start the event loop and run forever.
def run(self) -> None:
    '\n        \n        '
    log.debug('Running Websocket server')
    self.loop = asyncio.new_event_loop()
    asyncio.set_event_loop(self.loop)
    try:
        server_start = websockets.serve(self.handler, '127.0.0.1', WEBSOCKET_PORT, close_timeout=1)
        self.server = self.loop.run_until_complete(server_start)
        self.server_is_started.set()
        self.loop.run_forever()
    except OSError:
        log.exception('Server could not be started')
    finally:
        log.debug('loop stopped')
        log.debug('Pending tasks at close: %r', all_tasks(self.loop))
        self.loop.close()
        log.debug('loop closed')
        self.loop_is_closed.set()