def schedule_periodically(self, _interval, _callback, *_args, **_kwargs):
        if not isinstance(_interval, datetime.timedelta):
            _interval = datetime.timedelta(seconds=_interval)

        # Create ID for this periodic.
        id = self._get_schedule_handle()

        if self.run_thread != threading.current_thread().ident:
            # Schedule scheduling in IOLoop thread because of thread-safety.
            self.schedule(functools.partial(self._do_schedule_periodically, id, _interval, _callback, _args, _kwargs))
        else:
            self._do_schedule_periodically(id, _interval, _callback, _args, _kwargs)

        return id
Schedule a callback to be ran every `interval` seconds.
dataset/ETHPy150Open Shizmob/pydle/pydle/async.py/EventLoop.schedule_periodically