def start_server(broker, backend=None, port=12223,
                 max_tasks=10000, max_workers=100,
                 blocking=False, debug=False):  # pragma: no cover
    """Starts a Clearly Server programmatically."""
    _setup_logging(debug)

    queue_listener_dispatcher = Queue()
    listener = EventListener(broker, queue_listener_dispatcher, backend=backend,
                             max_tasks_in_memory=max_tasks,
                             max_workers_in_memory=max_workers)
    dispatcher = StreamingDispatcher(queue_listener_dispatcher)
    clearlysrv = ClearlyServer(listener, dispatcher)
    return _serve(clearlysrv, port, blocking)
Starts a Clearly Server programmatically.