Currently the SemaphoreExecutor internally uses the Sempahore method acquire . It blocks the operation until one permits is available. It is nice as VirtualThreads behavior is something similar but there are occasions that is preferable to fail-fast.
Having said that, it would be nice to have an option to configure a timeout which make the task fail if no permits are available when it expires.
Internally it would be using the Semaphore tryAcquire() method. And the api to add could be:
Currently the SemaphoreExecutor internally uses the Sempahore method
acquire
. It blocks the operation until one permits is available. It is nice as VirtualThreads behavior is something similar but there are occasions that is preferable tofail-fast
.Having said that, it would be nice to have an option to configure a timeout which make the task fail if no permits are available when it expires.
Internally it would be using the Semaphore tryAcquire() method. And the api to add could be:
@maxxedev if you think it is a nice feature, I am willing to contribute it.