Skip to content

Commit

Permalink
Added example for watch returning null
Browse files Browse the repository at this point in the history
  • Loading branch information
GumpacG committed Jun 13, 2024
1 parent 3a145be commit 61af157
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ public interface TransactionsBaseCommands {
* transaction.set("sampleKey", "foobar");
* Object[] result = client.exec(transaction).get();
* assert result != null; // Executes successfully and keys are unwatched.
*
* assert client.watch(new String[] {"sampleKey"}).get() == "OK";
* transaction.set("sampleKey", "foobar");
* assert client.set("sampleKey", "hello world").get() == "OK";
* Object[] result = client.exec(transaction).get();
* assert result == null; // null is returned when the watched key is modified before transaction execution.
* }</pre>
*/
CompletableFuture<String> watch(String[] keys);
Expand Down

0 comments on commit 61af157

Please sign in to comment.