T
- Data type for elements stored within the generated async.Queuepublic interface QueueFactory<T>
QueueFactories
Queue<String> transferQueue = QueueFactories.<String>boundedQueue(4)
.build();
new LazyReact(Executors.newFixedThreadPool(4)).generate(()->"data")
.map(d->"produced on " + Thread.currentThread().getId())
.peek(System.out::println)
.peek(d->transferQueue.offer(d))
.run();
transferQueue.stream()
.map(e->"Consumed on " + Thread.currentThread().getId())
.futureOperations(Executors.newFixedThreadPool(1))
.forEach(System.out::println);
Modifier and Type | Method and Description |
---|---|
Queue<T> |
build()
Build an async.Queue using this factory
|