Skip to content

Commit

Permalink
addressing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
TJ Zhang committed May 24, 2024
1 parent 8616008 commit af763d5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 36 deletions.
30 changes: 16 additions & 14 deletions java/client/src/main/java/glide/api/commands/ListBaseCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -376,54 +376,54 @@ CompletableFuture<Long> linsert(

/**
* Blocks the connection until it pops and pops one or more elements from the first non-empty list
* from the list of provided <code>key</code> <code>BLMPOP</code> is the blocking variant of
* <code>LMPOP</code>.
* from the provided <code>keys</code> <code>BLMPOP</code> is the blocking variant of <code>LMPOP
* </code>.
*
* @apiNote
* <ol>
* <li>When in cluster mode, all <code>keys</code> must map to the same <code>hash slot
* </code>.
* <li>When in cluster mode, all <code>keys</code> must map to the same hash slot.
* <li><code>BLMPOP</code> is a client blocking command, see <a
* href="https://github.com/aws/glide-for-redis/wiki/General-Concepts#blocking-commands">Blocking
* Commands</a> for more details and best practices.
* </ol>
*
* @since Redis 7.0 and above.
* @see <a href="https://valkey.io/commands/blmpop/">valkey.io</a> for details.
* @param keys The list of provided <code>key</code> names.
* @param keys An of array of keys to lists.
* @param direction The direction based on which elements are popped from - see {@link
* PopDirection}.
* @param count The count of elements to be popped and returned.
* @param count The maximum number of popped elements.
* @param timeout The number of seconds to wait for a blocking operation to complete. A value of
* <code>0</code> will block indefinitely.
* @return A <code>Map</code> of <code>key</code> name mapped array of popped elements. <br>
* If no member could be popped and the timeout expired, returns <code>null</code>.
* @example
* <pre>{@code
* Map<String, String[]> result = client.blmpop(new String[] {"testKey2"}, PopDirection.LEFT, 1L, 0.1).get();
* result.forEach((key, value) -> System.out.println("Key: " + key + ", Value: " + Arrays.toString(value)));
* client.lpush("testKey", new String[] {"one", "two", "three"}).get();
* Map<String, String[]> result = client.blmpop(new String[] {"testKey"}, PopDirection.LEFT, 1L, 0.1).get();
* String[] resultValue = result.get("testKey");
* assertArrayEquals(new String[] {"three"}, resultValue);
* }</pre>
*/
CompletableFuture<Map<String, String[]>> blmpop(
String[] keys, PopDirection direction, long count, double timeout);

/**
* Blocks the connection until it pops and pop one element from the first non-empty list from the
* list of provided <code>key</code> <code>BLMPOP</code> is the blocking variant of <code>LMPOP
* provided <code>keys</code> <code>BLMPOP</code> is the blocking variant of <code>LMPOP
* </code>.
*
* @apiNote
* <ol>
* <li>When in cluster mode, all <code>keys</code> must map to the same <code>hash slot
* </code>.
* <li>When in cluster mode, all <code>keys</code> must map to the same hash slot.
* <li><code>BLMPOP</code> is a client blocking command, see <a
* href="https://github.com/aws/glide-for-redis/wiki/General-Concepts#blocking-commands">Blocking
* Commands</a> for more details and best practices.
* </ol>
*
* @since Redis 7.0 and above.
* @see <a href="https://valkey.io/commands/lmpop/">valkey.io</a> for details.
* @param keys The list of provided <code>key</code> names.
* @param keys An of array of keys to lists.
* @param direction The direction based on which elements are popped from - see {@link
* PopDirection}.
* @param timeout The number of seconds to wait for a blocking operation to complete. A value of
Expand All @@ -432,8 +432,10 @@ CompletableFuture<Map<String, String[]>> blmpop(
* If no member could be popped and the timeout expired, returns <code>null</code>.
* @example
* <pre>{@code
* Map<String, String[]> result = client.blmpop(new String[] {"testKey2"}, PopDirection.LEFT, 1L, 0.1).get();
* result.forEach((key, value) -> System.out.println("Key: " + key + ", Value: " + Arrays.toString(value)));
* client.lpush("testKey", new String[] {"one", "two", "three"}).get();
* Map<String, String[]> result = client.blmpop(new String[] {"testKey"}, PopDirection.LEFT, 0.1).get();
* String[] resultValue = result.get("testKey");
* assertArrayEquals(new String[] {"three"}, resultValue);
* }</pre>
*/
CompletableFuture<Map<String, String[]>> blmpop(
Expand Down
32 changes: 10 additions & 22 deletions java/client/src/main/java/glide/api/models/BaseTransaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -3181,24 +3181,18 @@ public T getbit(@NonNull String key, long offset) {

/**
* Blocks the connection until it pops and pops one or more elements from the first non-empty list
* from the list of provided <code>key</code> <code>BLMPOP</code> is the blocking variant of
* <code>LMPOP</code>.
*
* @apiNote
* <ol>
* <li>When in cluster mode, all <code>keys</code> must map to the same <code>hash slot
* </code>.
* <li><code>BLMPOP</code> is a client blocking command, see <a
* href="https://github.com/aws/glide-for-redis/wiki/General-Concepts#blocking-commands">Blocking
* Commands</a> for more details and best practices.
* </ol>
* from the provided <code>keys</code> <code>BLMPOP</code> is the blocking variant of <code>LMPOP
* </code>.
*
* @apiNote <code>BLMPOP</code> is a client blocking command, see <a
* href="https://github.com/aws/glide-for-redis/wiki/General-Concepts#blocking-commands">Blocking
* Commands</a> for more details and best practices.
* @since Redis 7.0 and above.
* @see <a href="https://valkey.io/commands/blmpop/">valkey.io</a> for details.
* @param keys The list of provided <code>key</code> names.
* @param direction The direction based on which elements are popped from - see {@link
* PopDirection}.
* @param count The count of elements to be popped and returned.
* @param count The maximum number of popped elements.
* @param timeout The number of seconds to wait for a blocking operation to complete. A value of
* <code>0</code> will block indefinitely.
* @return Command Response - A <code>Map</code> of <code>key</code> names arrays of popped
Expand All @@ -3223,17 +3217,11 @@ public T blmpop(
}

/**
* Pops one element from the first non-empty list from the list of provided <code>key</code>
*
* @apiNote
* <ol>
* <li>When in cluster mode, all <code>keys</code> must map to the same <code>hash slot
* </code>.
* <li><code>BLMPOP</code> is a client blocking command, see <a
* href="https://github.com/aws/glide-for-redis/wiki/General-Concepts#blocking-commands">Blocking
* Commands</a> for more details and best practices.
* </ol>
* Pops one element from the first non-empty list from the provided <code>keys</code>
*
* @apiNote <code>BLMPOP</code> is a client blocking command, see <a
* href="https://github.com/aws/glide-for-redis/wiki/General-Concepts#blocking-commands">Blocking
* Commands</a> for more details and best practices.
* @since Redis 7.0 and above.
* @see <a href="https://valkey.io/commands/lmpop/">valkey.io</a> for details.
* @param keys The list of provided <code>key</code> names.
Expand Down

0 comments on commit af763d5

Please sign in to comment.