/** * Unlink the {@code key} from the keyspace. Unlike with {@link #del(ByteBuffer)} the actual memory reclaiming here * happens asynchronously. * * @param key must not be {@literal null}. * @return * @see <a href="http://redis.io/commands/unlink">Redis Documentation: UNLINK</a> * @since 2.1 */ default Mono<Long> unlink(ByteBuffer key) { Assert.notNull(key, "Keys must not be null!"); return unlink(Mono.just(key).map(KeyCommand::new)).next().map(NumericResponse::getOutput); }
@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 key} from the keyspace. Unlike with {@link #del(ByteBuffer)} the actual memory reclaiming here * happens asynchronously. * * @param key must not be {@literal null}. * @return * @see <a href="http://redis.io/commands/unlink">Redis Documentation: UNLINK</a> * @since 2.1 */ default Mono<Long> unlink(ByteBuffer key) { Assert.notNull(key, "Keys must not be null!"); return unlink(Mono.just(key).map(KeyCommand::new)).next().map(NumericResponse::getOutput); }
/** * Unlink the {@code key} from the keyspace. Unlike with {@link #del(ByteBuffer)} the actual memory reclaiming here * happens asynchronously. * * @param key must not be {@literal null}. * @return * @see <a href="http://redis.io/commands/unlink">Redis Documentation: UNLINK</a> * @since 2.1 */ default Mono<Long> unlink(ByteBuffer key) { Assert.notNull(key, "Keys must not be null!"); return unlink(Mono.just(key).map(KeyCommand::new)).next().map(NumericResponse::getOutput); }
@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))); }