@Override public void run() { input.forEach(ievent -> { queues.forEach(queue -> { /* * The original event is NOT sent to each fork. Rather a copy of the event is sent to * each fork. This ensures that there is no contention between the operations performed * on each event. Caveat is that when the forks join there will be two events produced. */ queue.offer(ievent.copy()); }); }); for (Queue<InternalEvent> queue : queues) { queue.close(); } } }).start();
@Override public void run() { input.forEach(ievent -> { queues.forEach(queue -> { /* * The original event is NOT sent to each fork. Rather a copy of the event is sent to * each fork. This ensures that there is no contention between the operations performed * on each event. Caveat is that when the forks join there will be two events produced. */ queue.offer(ievent.copy()); }); }); for (Queue<InternalEvent> queue : queues) { queue.close(); } } }).start();