def setup_server(config_path):
    """Configure SharQ server, start the requeue loop
    and return the server."""
    # configure the SharQ server
    server = SharQServer(config_path)
    # start the requeue loop
    gevent.spawn(server.requeue)

    return server