LoopyTimer不适用于异步上下文

时间:2019-12-18 15:17:10

标签: python multithreading asynchronous

我正在制作一个可抓取东西并刷新登录名和验证码的应用程序。我使用LoopyTimer,该线程是线程化的,以实现它循环,但是这不适用于异步函数。这是我的代码

        self.refresh_captcha = LoopyTimer(45, self.get_captcha)
        self.refresh_login = LoopyTimer(600, self.login)
        # Start our timers to renew captcha and login
        self.refresh_captcha.start()
        self.refresh_login.start()

我的目标是能够每隔X秒运行一次异步功能。

0 个答案:

没有答案