【发布时间】:2016-07-11 04:18:33
【问题描述】:
我想制作一个每 n 秒 (n>10) 轮询一次 SQL 数据库的程序。它验证特定列中的数据并基于它调用函数。
例如,
when column has '1' -> call function1
when column has '2' -> call function2
when column has '3' -> exits
我研究了多线程并看到了一个基于 threading.timer 的解决方案,这能满足我的用例吗?
此外,我会接受高达 +/-1 秒的时间漂移。
【问题讨论】:
标签: python sql-server multithreading scheduling