Hi,
On 28.1.14 10:14 , [email protected] wrote:
Author: jukka
Date: Tue Jan 28 21:14:06 2014
New Revision: 1562233
URL: http://svn.apache.org/r1562233
Log:
OAK-1133: Observation listener PLUS
+ public boolean hasNext() {
+ while (queue.isEmpty()) {
+ if (generator.isComplete()) {
+ return false;
+ } else {
+ generator.generate();
+ }
+ }
+ return true;
+ }
I don't like how this relies on side effects: generate() puts the events
into a queue owned by QueueingHandler and referenced by this class
(EventQueue).
Look how concise this was initially:
concat(listener.iterator(), concat(childEvents.iterator()));
just flatmap that shit ;-)
Now the same logic is sprinkled over three classes, which even live in
different modules.
Also EventQueue is not really a queue but just an iterator implementing
that flatmap by means of the generator and the queueing handler. Could
we at least somehow remove that explicit reference to the queue from
EventQueue and access it through the queueing handler?
Michael