它言行一致。
background的Python项目详细描述
这个模块使得在 应用程序,无论是cli应用程序还是web应用程序。
基本用法
import time import background @background.task def work(): # Do something expensive here. time.sleep(10) for _ in range(100): work()
高级用法
import background # Use 40 background threads. background.n = 40 @background.task def work(): import time time.sleep(10) @background.callback def work_callback(future): print(future) for _ in range(100): work()