Package org.redisson.api
Interface RFunctionAsync
-
- All Known Subinterfaces:
RFunction
- All Known Implementing Classes:
RedissonFuction
public interface RFunctionAsync
Interface for Redis Function feature- Author:
- Nikita Koksharov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <R> RFuture<R>
callAsync(String key, FunctionMode mode, String name, FunctionResult returnType, List<Object> keys, Object... values)
Executes function<R> RFuture<R>
callAsync(FunctionMode mode, String name, FunctionResult returnType)
Executes function<R> RFuture<R>
callAsync(FunctionMode mode, String name, FunctionResult returnType, List<Object> keys, Object... values)
Executes functionRFuture<Void>
deleteAsync(String libraryName)
Deletes library.RFuture<byte[]>
dumpAsync()
Returns serialized state of all libraries.RFuture<Void>
flushAsync()
Deletes all libraries.RFuture<Void>
killAsync()
Kills currently executed functions.RFuture<List<FunctionLibrary>>
listAsync()
Returns information about libraries and functions per each.RFuture<List<FunctionLibrary>>
listAsync(String namePattern)
Returns information about libraries and functions per each by name pattern.RFuture<Void>
loadAndReplaceAsync(String libraryName, String code)
Loads a library and overwrites existing library.RFuture<Void>
loadAsync(String libraryName, String code)
Loads a library.RFuture<Void>
restoreAfterFlushAsync(byte[] payload)
Restores libraries using their state returned bydumpAsync()
method.RFuture<Void>
restoreAndReplaceAsync(byte[] payload)
Restores libraries using their state returned bydumpAsync()
method.RFuture<Void>
restoreAsync(byte[] payload)
Restores libraries using their state returned bydumpAsync()
method.RFuture<FunctionStats>
statsAsync()
Returns information about currently running Redis function and available execution engines.
-
-
-
Method Detail
-
deleteAsync
RFuture<Void> deleteAsync(String libraryName)
Deletes library. Error is thrown if library doesn't exist.- Parameters:
libraryName
- library name
-
dumpAsync
RFuture<byte[]> dumpAsync()
Returns serialized state of all libraries.- Returns:
- serialized state
-
killAsync
RFuture<Void> killAsync()
Kills currently executed functions. Applied only to functions which don't modify data.
-
listAsync
RFuture<List<FunctionLibrary>> listAsync()
Returns information about libraries and functions per each.- Returns:
- list of libraries
-
listAsync
RFuture<List<FunctionLibrary>> listAsync(String namePattern)
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
- Parameters:
namePattern
- name pattern- Returns:
- list of libraries
-
loadAsync
RFuture<Void> loadAsync(String libraryName, String code)
Loads a library. Error is thrown if library already exists.- Parameters:
libraryName
- library namecode
- function code
-
loadAndReplaceAsync
RFuture<Void> loadAndReplaceAsync(String libraryName, String code)
Loads a library and overwrites existing library.- Parameters:
libraryName
- library namecode
- function code
-
restoreAsync
RFuture<Void> restoreAsync(byte[] payload)
Restores libraries using their state returned bydumpAsync()
method. Restored libraries are appended to the existing libraries and throws error in case of collision.- Parameters:
payload
- serialized state
-
restoreAndReplaceAsync
RFuture<Void> restoreAndReplaceAsync(byte[] payload)
Restores libraries using their state returned bydumpAsync()
method. Restored libraries are appended to the existing libraries.- Parameters:
payload
- serialized state
-
restoreAfterFlushAsync
RFuture<Void> restoreAfterFlushAsync(byte[] payload)
Restores libraries using their state returned bydumpAsync()
method. Deletes all existing libraries before restoring.- Parameters:
payload
- serialized state
-
statsAsync
RFuture<FunctionStats> statsAsync()
Returns information about currently running Redis function and available execution engines.- Returns:
- function information
-
callAsync
<R> RFuture<R> callAsync(String key, FunctionMode mode, String name, FunctionResult returnType, List<Object> keys, Object... values)
Executes function- Type Parameters:
R
- - type of result- Parameters:
key
- - used to locate Redis node in Cluster which stores cached Lua scriptmode
- - execution modename
- - function namereturnType
- - return typekeys
- - keys available through KEYS param in scriptvalues
- - values available through VALUES param in script- Returns:
- result object
-
callAsync
<R> RFuture<R> callAsync(FunctionMode mode, String name, FunctionResult returnType, List<Object> keys, Object... values)
Executes function- Type Parameters:
R
- - type of result- Parameters:
mode
- - execution modename
- - function namereturnType
- - return typekeys
- - keys available through KEYS param in scriptvalues
- - values available through VALUES param in script- Returns:
- result object
-
callAsync
<R> RFuture<R> callAsync(FunctionMode mode, String name, FunctionResult returnType)
Executes function- Type Parameters:
R
- - type of result- Parameters:
mode
- - execution modename
- - function namereturnType
- - return type- Returns:
- result object
-
-