def handle_gathering_event(cls, gather_obj):
'''
This is the method called by the scheduler when an event expires
This basically takes the gatherer instance given as args to the scheduler
And calls its measurement function.
To avoid timing issues while measuring a new event for the next call is
created before the measurement call.
'''
delay_in_sec = ms_to_sec(gather_obj.delayms)
new_gather_event = cls.scheduler.enter(delay_in_sec, GATHERING_EVENT_PRIORITY,
cls.handle_gathering_event,
kwargs={
"gather_obj": gather_obj
})
gather_obj.set_event(new_gather_event)
gather_obj.measure()
gatherer_manager.py 文件源码
python
阅读 19
收藏 0
点赞 0
评论 0
评论列表
文章目录