-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Java: Add `FCALL` command. (#307) Signed-off-by: Yury-Fridlyand <[email protected]>
- Loading branch information
1 parent
529a3a3
commit 24fb145
Showing
16 changed files
with
523 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
java/client/src/main/java/glide/api/commands/ScriptingAndFunctionsBaseCommands.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** Copyright GLIDE-for-Redis Project Contributors - SPDX Identifier: Apache-2.0 */ | ||
package glide.api.commands; | ||
|
||
import java.util.concurrent.CompletableFuture; | ||
|
||
/** | ||
* Supports commands and transactions for the "Scripting and Function" group for standalone and | ||
* cluster clients. | ||
* | ||
* @see <a href="https://redis.io/docs/latest/commands/?group=scripting">Scripting and Function | ||
* Commands</a> | ||
*/ | ||
public interface ScriptingAndFunctionsBaseCommands { | ||
|
||
/** | ||
* Invokes a previously loaded function. | ||
* | ||
* @apiNote When in cluster mode | ||
* <ul> | ||
* <li>all <code>keys</code> must map to the same hash slot. | ||
* <li>if no <code>keys</code> are given, command will be routed to a random node. | ||
* </ul> | ||
* | ||
* @since Redis 7.0 and above. | ||
* @see <a href="https://redis.io/docs/latest/commands/fcall/">redis.io</a> for details. | ||
* @param function The function name. | ||
* @param keys An <code>array</code> of keys accessed by the function. To ensure the correct | ||
* execution of functions, both in standalone and clustered deployments, all names of keys | ||
* that a function accesses must be explicitly provided as <code>keys</code>. | ||
* @param arguments An <code>array</code> of <code>function</code> arguments. <code>Arguments | ||
* </code> should not represent names of keys. | ||
* @return The invoked function's return value. | ||
* @example | ||
* <pre>{@code | ||
* String[] args = new String[] { "Answer", "to", "the", "Ultimate", "Question", "of", "Life,", "the", "Universe,", "and", "Everything"}; | ||
* Object response = client.fcall("Deep_Thought", new String[0], args).get(); | ||
* assert response == 42L; | ||
* }</pre> | ||
*/ | ||
CompletableFuture<Object> fcall(String function, String[] keys, String[] arguments); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.