def _handler(parameters: Sequence[Parameter], interval: float) -> Callable[([websockets.WebSocketServerProtocol, str], Awaitable[None])]:
    '\n    Return the websockets server handler.\n    '

    async def server_func(websocket: websockets.WebSocketServerProtocol, _: str) -> None:
        '\n        Create a websockets handler that sends parameter values to a listener\n        every "interval" seconds.\n        '
        while True:
            try:
                try:
                    meta = _get_metadata(*parameters)
                except ValueError:
                    log.exception('Error getting parameters')
                    break
                log.debug('sending.. to %r', websocket)
                (await websocket.send(json.dumps(meta)))
                (await asyncio.sleep(interval))
            except (CancelledError, websockets.exceptions.ConnectionClosed):
                log.debug('Got CancelledError or ConnectionClosed', exc_info=True)
                break
        log.debug('Closing websockets connection')
    return server_func
Return the websockets server handler.
def _handler(parameters: Sequence[Parameter], interval: float) -> Callable[([websockets.WebSocketServerProtocol, str], Awaitable[None])]:
    '\n    \n    '

    async def server_func(websocket: websockets.WebSocketServerProtocol, _: str) -> None:
        '\n        Create a websockets handler that sends parameter values to a listener\n        every "interval" seconds.\n        '
        while True:
            try:
                try:
                    meta = _get_metadata(*parameters)
                except ValueError:
                    log.exception('Error getting parameters')
                    break
                log.debug('sending.. to %r', websocket)
                (await websocket.send(json.dumps(meta)))
                (await asyncio.sleep(interval))
            except (CancelledError, websockets.exceptions.ConnectionClosed):
                log.debug('Got CancelledError or ConnectionClosed', exc_info=True)
                break
        log.debug('Closing websockets connection')
    return server_func