Hello,
Suppose I have two streams like so (using Java notation):
Stream<Foo> sA = ...
Stream<Foo> sB = ...
Now I want to merge them into a Stream<Foo> sC
, and if there are simultaneous events I want to use the value from sA
:
Stream<Foo> sC = sA.merge(sB, (a, b) -> {System.out.println("simultaneous events occurred"); return a;});
My question is: does the "order" of the merge matter here? E.g. would the above result in the same behavior as:
Stream<Foo> sC = sB.merge(sA, (b, a) -> {...return a;});
Intuitively I thought that the order shouldn't matter. Yet in my program, when I define it using one order, I see the message "simultaneous events" getting printed, but using the other order, I don't! Could I have ran into a bug?
Thanks,
Chris