def METHOD_NAME(args):
    """
    This is functionally a barrier if run with flux exec on all broker ranks.
    If --leave is specified, leave explicitly, otherwise just disconnect.
    """
    h = flux.Flux()
    size = int(h.attr_get("size"))
    fullset = IDset("0-" + str(size - 1))
    entry = h.rpc(
        "groups.get",
        {"name": args.name},
        nodeid=0,
        flags=flux.constants.FLUX_RPC_STREAMING,
    )
    entry.then(barrier_continuation, fullset)
    h.rpc("groups.join", {"name": args.name})
    h.reactor_run()  # run until idset is full
    if args.leave:
        h.rpc("groups.leave", {"name": args.name}).get()