def schedule(self, action, state=None):

        scheduler = self
        disposable = SingleAssignmentDisposable()

        def interval():
            disposable.disposable = action(scheduler, state)

        alarm = self.master.after_idle(interval)

        def dispose():
            # nonlocal alarm
            self.master.after_cancel(alarm)

        return CompositeDisposable(disposable, Disposable(dispose))
Schedules an action to be executed.
dataset/ETHPy150Open ReactiveX/RxPY/rx/concurrency/mainloopscheduler/tkinterscheduler.py/TkinterScheduler.schedule