public class ThreadLocker extends Object
MessageProducer#send
and providing a callback (via a CompletableFuture
) that is invoked
once the desired number of threads is reached.
If a larger number of threads than expected call MessageProducer#send
,
these are locked as well, and the number of these is provided by
getNumExtraThreadsWaiting()
.Constructor and Description |
---|
ThreadLocker() |
Modifier and Type | Method and Description |
---|---|
int |
getNumExtraThreadsWaiting() |
void |
park() |
void |
release() |
CompletableFuture<Integer> |
waitForThreads(int numThreads) |
public CompletableFuture<Integer> waitForThreads(int numThreads)
public void park()
public void release()
public int getNumExtraThreadsWaiting()
Copyright © 2021. All rights reserved.