reactfx/src/main/java/org/reactfx/EventStreams.java
public static EventStream<?> ticks(
            Duration interval,
            ScheduledExecutorService scheduler,
            Executor eventThreadExecutor) {
        return new EventStreamBase<Void>() {
            private final Timer timer = ScheduledExecutorServiceTimer.createPeriodic(
                    interval, () -> emit(null), scheduler, eventThreadExecutor);

            @Override
            protected Subscription observeInputs() {
                timer.restart();
                return timer::stop;
            }
        };
    }
public static EventStream<?> ticks(
            Duration interval,
            ScheduledExecutorService scheduler,
            Executor eventThreadExecutor) {
        return new EventStreamBase<Void>() {
            private final Timer timer = ScheduledExecutorServiceTimer.createPeriodic(
                    interval, () -> emit(null), scheduler, eventThreadExecutor);

            @Override
            protected Subscription observeInputs() {
                timer.restart();
                return timer::stop;
            }
        };
    }
Returns an event stream that emits periodic <i>ticks</i> on the given
{@code eventThreadExecutor}. The returned stream may only be used from
that executor's thread.

<p>As with all lazily bound streams, ticks are emitted only when there
is at least one subscriber to the returned stream. This means that to
release associated resources, it suffices to unsubscribe from the
returned stream.

@param scheduler scheduler used to schedule periodic emissions.
@param eventThreadExecutor single-thread executor used to emit the ticks.