【发布时间】:2017-01-07 11:32:50
【问题描述】:
我是事件驱动编程范式的新手,正在阅读 Twisted。
在这个关于 Reactor 的问题中, How does Python's Twisted Reactor work?
timeout = time_until_next_timed_event()
events = wait_for_events(timeout)
events += timed_events_until(now())
从逻辑上讲,不会有timeout = time_until_next_timed_event() 被计算为12 Hours 的情况,而event = wait_for_events(timeout) 只是等待12 Hours,因为没有发生外部触发,它只是错过了服务任何timed_events_until(now()) 事件,理想情况下它可以吗?这不是妥协吗?
我很确定我遗漏了什么,谁能从逻辑的角度澄清这一点?
【问题讨论】: