class MultiOutput<K, V> extends CommandOutput<K, V, TransactionResult> {

    private final Queue<RedisCommand<K, V, ?>> queue;

    private List<Object> responses = new ArrayList<>();

    private Boolean discarded;

    private Integer multi;

    public MultiOutput(RedisCodec<K, V> codec) {
        super(codec, null);
        queue = LettuceFactories.newSpScQueue();
    }

    public void add(RedisCommand<K, V, ?> cmd) {
        queue.add(cmd);
    }

    public void cancel() {<FILL_FUNCTION_BODY>}

    @Override
    public void set(long integer) {
        RedisCommand<K, V, ?> command = queue.peek();
        if (command != null && command.getOutput() != null) {
            command.getOutput().set(integer);
        }
    }

    @Override
    public void setSingle(ByteBuffer bytes) {
        RedisCommand<K, V, ?> command = queue.peek();
        if (command != null && command.getOutput() != null) {
            command.getOutput().setSingle(bytes);
        }
    }

    @Override
    public void setBigNumber(ByteBuffer bytes) {
        RedisCommand<K, V, ?> command = queue.peek();
        if (command != null && command.getOutput() != null) {
            command.getOutput().setBigNumber(bytes);
        }
    }

    @Override
    public void set(double number) {
        RedisCommand<K, V, ?> command = queue.peek();
        if (command != null && command.getOutput() != null) {
            command.getOutput().set(number);
        }
    }

    @Override
    public void set(ByteBuffer bytes) {

        if (multi == null && bytes == null) {
            discarded = true;
            return;
        }

        RedisCommand<K, V, ?> command = queue.peek();
        if (command != null && command.getOutput() != null) {
            command.getOutput().set(bytes);
        }
    }

    @Override
    public void multi(int count) {

        if (multi == null) {
            multi = count;
        }
        if (discarded == null) {
            discarded = count == -1;
        } else {
            if (!queue.isEmpty()) {
                queue.peek().getOutput().multi(count);
            }
        }
    }

    @Override
    public void setError(ByteBuffer error) {

        if (discarded == null) {
            super.setError(error);
            return;
        }

        CommandOutput<K, V, ?> output = queue.isEmpty() ? this : queue.peek().getOutput();
        output.setError(decodeAscii(error));
    }

    @Override
    public void complete(int depth) {

        if (queue.isEmpty()) {
            return;
        }

        if (depth >= 1) {
            RedisCommand<K, V, ?> cmd = queue.peek();
            cmd.getOutput().complete(depth - 1);
        }

        if (depth == 1) {
            RedisCommand<K, V, ?> cmd = queue.remove();
            CommandOutput<K, V, ?> o = cmd.getOutput();
            responses.add(!o.hasError() ? o.get() : ExceptionFactory.createExecutionException(o.getError()));
            cmd.complete();
        } else if (depth == 0 && !queue.isEmpty()) {
            for (RedisCommand<K, V, ?> cmd : queue) {
                cmd.complete();
            }
        }
    }

    @Override
    public TransactionResult get() {
        return new DefaultTransactionResult(discarded == null ? false : discarded, responses);
    }

}

        for (RedisCommand<K, V, ?> c : queue) {
            c.complete();
        }
    
<methods>public void <init>(RedisCodec<K,V>, io.lettuce.core.TransactionResult) ,public void complete(int) ,public io.lettuce.core.TransactionResult get() ,public java.lang.String getError() ,public boolean hasError() ,public void multi(int) ,public void multiArray(int) ,public void multiMap(int) ,public void multiPush(int) ,public void multiSet(int) ,public void set(java.nio.ByteBuffer) ,public void set(long) ,public void set(double) ,public void set(boolean) ,public void setBigNumber(java.nio.ByteBuffer) ,public void setError(java.nio.ByteBuffer) ,public void setError(java.lang.String) ,public void setSingle(java.nio.ByteBuffer) ,public java.lang.String toString() <variables>protected final non-sealed RedisCodec<K,V> codec,protected java.lang.String error,protected io.lettuce.core.TransactionResult output