permits
.
- * Waits if necessary until all permits became available.
+ * Waits if necessary until enough permits became available.
*
* @param permits the number of permits to acquire
* @return permits ids
@@ -64,7 +64,7 @@ public interface RPermitExpirableSemaphore extends RExpirable, RPermitExpirableS
/**
* Acquires defined amount of permits
with defined leaseTime
and returns ids.
- * Waits if necessary until all permits became available.
+ * Waits if necessary until enough permits became available.
*
* @param permits the number of permits to acquire
* @param leaseTime permit lease time
@@ -87,7 +87,7 @@ public interface RPermitExpirableSemaphore extends RExpirable, RPermitExpirableS
* Tries to acquire defined amount of currently available permits
and returns ids.
*
* @param permits the number of permits to acquire
- * @return permits ids if permits were acquired and empty list
+ * @return permits ids if permits were acquired and empty collection
* otherwise
* @throws IllegalArgumentException if permits
is negative
*/
@@ -122,13 +122,13 @@ public interface RPermitExpirableSemaphore extends RExpirable, RPermitExpirableS
/**
* Tries to acquire defined amount of currently available permits
* with defined leaseTime
and return ids.
- * Waits up to defined waitTime
if necessary until permits became available.
+ * Waits up to defined waitTime
if necessary until enough permits became available.
*
* @param permits the number of permits to acquire
* @param waitTime the maximum time to wait
* @param leaseTime permit lease time, use -1 to make it permanent
* @param unit the time unit
- * @return permits ids if permits were acquired and empty list
+ * @return permits ids if permits were acquired and empty collection
* if the waiting time elapsed before permits were acquired
* @throws InterruptedException if the current thread is interrupted
* @throws IllegalArgumentException if permits
is negative
@@ -164,7 +164,7 @@ public interface RPermitExpirableSemaphore extends RExpirable, RPermitExpirableS
void release(String permitId);
/**
- * Releases a permits by their ids. Increases the number of available permits.
+ * Releases permits by their ids. Increases the number of available permits.
*
* @param permitsIds - permits ids
* @throws IllegalArgumentException if permitsIds
is null or empty
diff --git a/redisson/src/main/java/org/redisson/api/RPermitExpirableSemaphoreReactive.java b/redisson/src/main/java/org/redisson/api/RPermitExpirableSemaphoreReactive.java
index dfa9491f9..94b2a6cce 100644
--- a/redisson/src/main/java/org/redisson/api/RPermitExpirableSemaphoreReactive.java
+++ b/redisson/src/main/java/org/redisson/api/RPermitExpirableSemaphoreReactive.java
@@ -15,8 +15,10 @@
*/
package org.redisson.api;
+import java.util.List;
import java.util.concurrent.TimeUnit;
+import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
/**
@@ -39,6 +41,15 @@ public interface RPermitExpirableSemaphoreReactive extends RExpirableReactive {
* @return permit id
*/
Monopermits
.
+ * Waits if necessary until all permits became available.
+ *
+ * @param permits the number of permits to acquire
+ * @return permits ids
+ */
+ FluxleaseTime
and return its id.
@@ -49,6 +60,17 @@ public interface RPermitExpirableSemaphoreReactive extends RExpirableReactive {
* @return permit id
*/
Monopermits
with defined leaseTime
and returns ids.
+ * Waits if necessary until all permits became available.
+ *
+ * @param permits the number of permits to acquire
+ * @param leaseTime permits lease time
+ * @param unit time unit
+ * @return permits ids
+ */
+ Fluxpermits
and returns ids.
+ *
+ * @param permits the number of permits to acquire
+ * @return permits ids if permits were acquired and empty collection
+ * otherwise
+ */
+ FluxwaitTime
if necessary until a permit became available.
@@ -81,6 +112,20 @@ public interface RPermitExpirableSemaphoreReactive extends RExpirableReactive {
* if the waiting time elapsed before a permit was acquired
*/
Monopermits
+ * with defined leaseTime
and return their ids.
+ * Waits up to defined waitTime
if necessary until enough permits became available.
+ *
+ * @param permits the number of permits to acquire
+ * @param waitTime the maximum time to wait
+ * @param leaseTime permits lease time, use -1 to make them permanent
+ * @param unit the time unit
+ * @return permits ids if permits were acquired and empty collection
+ * if the waiting time elapsed before permits were acquired
+ */
+ Fluxpermits
from this semaphore, blocking until enough permits are
+ * available, or the thread is {@linkplain Thread#interrupt interrupted}.
+ *
+ * Acquires permits
permits, if they are available and returns their ids,
+ * reducing the number of available permits by permits
.
+ *
+ *
If not enough permits are available then the current thread becomes + * disabled for thread scheduling purposes and lies dormant until + * one of two things happens: + *
permits
with defined lease time from this semaphore,
+ * blocking until enough permits are available,
+ * or the thread is {@linkplain Thread#interrupt interrupted}.
+ *
+ * Acquires permits
permits, if they are available and returns their ids,
+ * reducing the number of available permits by permits
.
+ *
+ *
If not enough permits are available then the current thread becomes + * disabled for thread scheduling purposes and lies dormant until + * one of two things happens: + *
permits
only if they are available at the
+ * time of invocation.
+ *
+ * Acquires permits
permits, if they are available and returns immediately,
+ * with the permits ids,
+ * reducing the number of available permits by permits
.
+ *
+ *
If not enough permits are available then this method will return
+ * immediately with empty collection.
+ *
+ * @param permits - the number of permits to acquire
+ * @return permits ids if permit were acquired and empty collection
+ * otherwise
+ */
+ Flowable Acquires If not enough permits are available then the current thread becomes
+ * disabled for thread scheduling purposes and lies dormant until
+ * one of three things happens:
+ * If permit are acquired then permits ids are returned.
+ *
+ * If the specified waiting time elapses then the empty collection
+ * is returned. If the time is less than or equal to zero, the method
+ * will not wait at all.
+ *
+ * @param permits the number of permits to acquire
+ * @param waitTime the maximum time to wait for permits
+ * @param leaseTime permits lease time
+ * @param unit the time unit of the {@code timeout} argument
+ * @return permits ids if permit were acquired and empty collection
+ * if the waiting time elapsed before permits were acquired
+ */
+ Flowable Releases There is no requirement that a thread that releases permits must
+ * have acquired that permit by calling {@link #acquire()}.
+ * Correct usage of a semaphore is established by programming convention
+ * in the application.
+ *
+ * @param permitsIds - permits ids
+ * @return amount of released permits
+ */
+ Single Releases There is no requirement that a thread that releases permits must
+ * have acquired that permit by calling {@link #acquire()}.
+ * Correct usage of a semaphore is established by programming convention
+ * in the application.
+ *
+ * @param permitsIds - permits ids
+ * @return amount of released permits
+ */
+ Singlepermits
with defined lease time from this semaphore,
+ * if enough permits become available
+ * within the given waiting time and the current thread has not
+ * been {@linkplain Thread#interrupt interrupted}.
+ *
+ * permits
permits, if they are available and returns immediately,
+ * with the permits ids,
+ * reducing the number of available permits by permits
.
+ *
+ *
+ *
+ *
+ * permits
permits, increasing the number of available permits
+ * by released amount. If any threads of Redisson client are trying to acquire a permit,
+ * then one is selected and given one of the permits that were just released.
+ *
+ * permits
permits, increasing the number of available permits
+ * by released amount. If any threads of Redisson client are trying to acquire a permit,
+ * then one is selected and given the permit that were just released.
+ *
+ *