@Override public void onSubscribe(final Disposable d) { Schedulers.single().scheduleDirect(new Runnable() { @Override public void run() { d.dispose(); } }, 550, TimeUnit.MILLISECONDS); }
/** * Synchronizes the execution of two runnables (as much as possible) * to test race conditions. * <p>The method blocks until both have run to completion. * @param r1 the first runnable * @param r2 the second runnable */ public static void race(final Runnable r1, final Runnable r2) { race(r1, r2, Schedulers.single()); } /**