QueueThing: add ability to request a specific item for processing.

soundboard
Nekojimi 8 months ago
parent 88c51129d2
commit 8f35828c84
  1. 12
      src/main/java/moe/nekojimi/chords/QueueThing.java

@ -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…
Cancel
Save