waitN


Description:

public Result<bool,Error> waitN (int permits)

Waits until n permits are available and acquires them.

This method blocks the caller thread until enough permits are available.

Parameters:

permits

number of permits.

Returns:

Result.ok(true) when permits are acquired, or Result.error(RateLimiterError.INVALID_ARGUMENT) when permits is not positive or exceeds burst capacity.