public class FetcherThreads extends Object
key
from a queue.FetcherThreads
are employed by the cache to
asynchronously load values.Constructor and Description |
---|
FetcherThreads(BlockingFetchQueues<Callable<?>> queue,
int numFetcherThreads)
Create (and start) a set of fetcher threads.
|
FetcherThreads(BlockingFetchQueues<Callable<?>> queue,
int numFetcherThreads,
IntFunction<String> threadIndexToName)
Create (and start) a set of fetcher threads.
|
Modifier and Type | Method and Description |
---|---|
void |
pauseFor(long ms)
Pause all Fetcher threads for the specified number of milliseconds.
|
void |
pauseUntil(long timeMillis)
pause all Fetcher threads until the given time (see
System.currentTimeMillis() ). |
void |
shutdown() |
void |
wakeUp()
Wake up all Fetcher threads immediately.
|
public FetcherThreads(BlockingFetchQueues<Callable<?>> queue, int numFetcherThreads)
Fetcher threads are named Fetcher-0
... Fetcher-n
.
queue
- the queue from which request keys are taken.numFetcherThreads
- how many parallel fetcher threads to start.public FetcherThreads(BlockingFetchQueues<Callable<?>> queue, int numFetcherThreads, IntFunction<String> threadIndexToName)
queue
- the queue from which request keys are taken.numFetcherThreads
- how many parallel fetcher threads to start.threadIndexToName
- a function for naming fetcher threads (takes an index and returns a name).public void pauseFor(long ms)
public void pauseUntil(long timeMillis)
System.currentTimeMillis()
).public void wakeUp()
pauseFor(long)
and
pauseUntil(long)
set earlier.public void shutdown()
Copyright © 2015–2022 ImgLib2. All rights reserved.