obs2, Func2<? super T1, ? super T2, R> fn) { return observer -> { Queue<T1> q1 = new ArrayDeque<>(); Queue<T2> q2 = new ArrayDeque<>(); Runnable r1 = obs1.subscribe(t1 -> { T2 t2 = q2.poll(); if (t2 == null) { q1.add(t1); } else { observer.onEvent(fn.call(t1, t2)); } }); Runnable r2 = obs2.subscribe(t2 -> { T1 t1 = q1.poll(); if (t1 == null) { q2.add(t2); } else { observer.onEvent(fn.call(t1, t2)); } }); return () -> {r1.run(); r2.run();}; }; }