autoreload.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:time2go 作者: twitchyliquid64 项目源码 文件源码
def start(io_loop=None, check_time=500):
    """Restarts the process automatically when a module is modified.

    We run on the I/O loop, and restarting is a destructive operation,
    so will terminate any pending requests.
    """
    io_loop = io_loop or ioloop.IOLoop.instance()
    add_reload_hook(functools.partial(_close_all_fds, io_loop))
    modify_times = {}
    callback = functools.partial(_reload_on_update, modify_times)
    scheduler = ioloop.PeriodicCallback(callback, check_time, io_loop=io_loop)
    scheduler.start()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号