QueueThing: add ability to request a specific item for processing.
This commit is contained in:
parent
88c51129d2
commit
8f35828c84
|
@ -74,6 +74,18 @@ public abstract class QueueThing<I, O> implements Consumer<I>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Promise<I, O>> requestSpecific(List<I> inputs, Consumer<O> destination)
|
||||||
|
{
|
||||||
|
List<Promise<I, O>> ret = new ArrayList<>();
|
||||||
|
for (I input : inputs)
|
||||||
|
{
|
||||||
|
Promise<I, O> promise = new Promise<>(input, destination);
|
||||||
|
ret.add(promise);
|
||||||
|
handlePromise(promise);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
public List<Promise<I, O>> request(int count, Consumer<O> destination)
|
public List<Promise<I, O>> request(int count, Consumer<O> destination)
|
||||||
{
|
{
|
||||||
List<Promise<I, O>> ret = new ArrayList<>();
|
List<Promise<I, O>> ret = new ArrayList<>();
|
||||||
|
|
Loading…
Reference in New Issue