@Override public void changed(ObservableValue<? extends T> observable, T oldValue, T newValue) { if (this.currentSubscription != null) { this.currentSubscription.dispose(); } this.currentSubscription = scheduleExecution(delay, () -> { consumer.accept(newValue); this.currentSubscription = null; }); } };
public final RController sleep(long millis) { BlockCondition<Void> b = new BlockCondition<>(); this.threadSynchronize.scheduleExecution(millis, () -> b.release(null)); this.threadSynchronize.block(b); return this; } }