/** * Unlink the {@code keys} from the keyspace. Unlike with {@link #mDel(List)} the actual memory reclaiming here * happens asynchronously. * * @param keys must not be {@literal null}. * @return * @see <a href="http://redis.io/commands/unlink">Redis Documentation: UNLINK</a> * @since 2.1 */ default Mono<Long> mUnlink(List<ByteBuffer> keys) { Assert.notNull(keys, "Keys must not be null!"); return mUnlink(Mono.just(keys)).next().map(NumericResponse::getOutput); }
@Override public Mono<Long> unlink(Publisher<K> keys) { Assert.notNull(keys, "Keys must not be null!"); return createFlux(connection -> connection.keyCommands() // .mUnlink(Flux.from(keys).map(this::rawKey).buffer(128)) // .map(CommandResponse::getOutput)) // .collect(Collectors.summingLong(value -> value)); }
@Override @SafeVarargs public final Mono<Long> unlink(K... keys) { Assert.notNull(keys, "Keys must not be null!"); Assert.notEmpty(keys, "Keys must not be empty!"); Assert.noNullElements(keys, "Keys must not contain null elements!"); if (keys.length == 1) { return createMono(connection -> connection.keyCommands().unlink(rawKey(keys[0]))); } Mono<List<ByteBuffer>> listOfKeys = Flux.fromArray(keys).map(this::rawKey).collectList(); return createMono(connection -> listOfKeys.flatMap(rawKeys -> connection.keyCommands().mUnlink(rawKeys))); }
/** * Unlink the {@code keys} from the keyspace. Unlike with {@link #mDel(List)} the actual memory reclaiming here * happens asynchronously. * * @param keys must not be {@literal null}. * @return * @see <a href="http://redis.io/commands/unlink">Redis Documentation: UNLINK</a> * @since 2.1 */ default Mono<Long> mUnlink(List<ByteBuffer> keys) { Assert.notNull(keys, "Keys must not be null!"); return mUnlink(Mono.just(keys)).next().map(NumericResponse::getOutput); }
/** * Unlink the {@code keys} from the keyspace. Unlike with {@link #mDel(List)} the actual memory reclaiming here * happens asynchronously. * * @param keys must not be {@literal null}. * @return * @see <a href="http://redis.io/commands/unlink">Redis Documentation: UNLINK</a> * @since 2.1 */ default Mono<Long> mUnlink(List<ByteBuffer> keys) { Assert.notNull(keys, "Keys must not be null!"); return mUnlink(Mono.just(keys)).next().map(NumericResponse::getOutput); }
@Override public Mono<Long> unlink(Publisher<K> keys) { Assert.notNull(keys, "Keys must not be null!"); return createFlux(connection -> connection.keyCommands() // .mUnlink(Flux.from(keys).map(this::rawKey).buffer(128)) // .map(CommandResponse::getOutput)) // .collect(Collectors.summingLong(value -> value)); }
@Override public Mono<Long> unlink(Publisher<K> keys) { Assert.notNull(keys, "Keys must not be null!"); return createFlux(connection -> connection.keyCommands() // .mUnlink(Flux.from(keys).map(this::rawKey).buffer(128)) // .map(CommandResponse::getOutput)) // .collect(Collectors.summingLong(value -> value)); }
@Override @SafeVarargs public final Mono<Long> unlink(K... keys) { Assert.notNull(keys, "Keys must not be null!"); Assert.notEmpty(keys, "Keys must not be empty!"); Assert.noNullElements(keys, "Keys must not contain null elements!"); if (keys.length == 1) { return createMono(connection -> connection.keyCommands().unlink(rawKey(keys[0]))); } Mono<List<ByteBuffer>> listOfKeys = Flux.fromArray(keys).map(this::rawKey).collectList(); return createMono(connection -> listOfKeys.flatMap(rawKeys -> connection.keyCommands().mUnlink(rawKeys))); }
@Override @SafeVarargs public final Mono<Long> unlink(K... keys) { Assert.notNull(keys, "Keys must not be null!"); Assert.notEmpty(keys, "Keys must not be empty!"); Assert.noNullElements(keys, "Keys must not contain null elements!"); if (keys.length == 1) { return createMono(connection -> connection.keyCommands().unlink(rawKey(keys[0]))); } Mono<List<ByteBuffer>> listOfKeys = Flux.fromArray(keys).map(this::rawKey).collectList(); return createMono(connection -> listOfKeys.flatMap(rawKeys -> connection.keyCommands().mUnlink(rawKeys))); }