All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.redisson.api.RFunctionReactive Maven / Gradle / Ivy

Go to download

Easy Redis Java client and Real-Time Data Platform. Valkey compatible. Sync/Async/RxJava3/Reactive API. Client side caching. Over 50 Redis based Java objects and services: JCache API, Apache Tomcat, Hibernate, Spring, Set, Multimap, SortedSet, Map, List, Queue, Deque, Semaphore, Lock, AtomicLong, Map Reduce, Bloom filter, Scheduler, RPC

The newest version!
/**
 * Copyright (c) 2013-2024 Nikita Koksharov
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.redisson.api;

import reactor.core.publisher.Mono;

import java.util.List;

/**
 * Interface for Redis Function feature
 *
 * @author Nikita Koksharov
 *
 */
public interface RFunctionReactive {

    /**
     * Deletes library. Error is thrown if library doesn't exist.
     *
     * @param libraryName library name
     */
    Mono delete(String libraryName);

    /**
     * Returns serialized state of all libraries.
     *
     * @return serialized state
     */
    Mono dump();

    /**
     * Deletes all libraries.
     *
     */
    Mono flush();

    /**
     * Kills currently executed functions.
     * Applied only to functions which don't modify data.
     *
     */
    Mono kill();

    /**
     * Returns information about libraries and functions per each.
     *
     * @return list of libraries
     */
    Mono> list();

    /**
     * Returns information about libraries and functions per each by name pattern.
     * 

* Supported glob-style patterns: * h?llo matches hello, hallo and hxllo * h*llo matches hllo and heeeello * h[ae]llo matches hello and hallo, but not hillo * * @param namePattern name pattern * @return list of libraries */ Mono> list(String namePattern); /** * Loads a library. Error is thrown if library already exists. * * @param libraryName library name * @param code function code */ Mono load(String libraryName, String code); /** * Loads a library and overwrites existing library. * * @param libraryName library name * @param code function code */ Mono loadAndReplace(String libraryName, String code); /** * Restores libraries using their state returned by {@link #dump()} method. * Restored libraries are appended to the existing libraries and throws error in case of collision. * * @param payload serialized state */ Mono restore(byte[] payload); /** * Restores libraries using their state returned by {@link #dump()} method. * Restored libraries are appended to the existing libraries. * * @param payload serialized state */ Mono restoreAndReplace(byte[] payload); /** * Restores libraries using their state returned by {@link #dump()} method. * Deletes all existing libraries before restoring. * * @param payload serialized state */ Mono restoreAfterFlush(byte[] payload); /** * Returns information about currently running * Redis function and available execution engines. * * @return function information */ Mono stats(); /** * Executes function * * @param - type of result * @param key - used to locate Redis node in Cluster * @param mode - execution mode * @param name - function name * @param returnType - return type * @param keys - keys available through KEYS param in script * @param values - values available through VALUES param in script * @return result object */ Mono call(String key, FunctionMode mode, String name, FunctionResult returnType, List keys, Object... values); /** * Executes function * * @param - type of result * @param mode - execution mode * @param name - function name * @param returnType - return type * @param keys - keys available through KEYS param in script * @param values - values available through VALUES param in script * @return result object */ Mono call(FunctionMode mode, String name, FunctionResult returnType, List keys, Object... values); /** * Executes function * * @param - type of result * @param mode - execution mode * @param name - function name * @param returnType - return type * @return result object */ Mono call(FunctionMode mode, String name, FunctionResult returnType); }