APScheduler - 运行 同时执行多个作业

APScheduler - running multiple jobs at the same time

在 APScheduler docs 中是:

By default, only one instance of each job is allowed to be run at the same time. This means that if the job is about to be run but the previous run hasn’t finished yet, then the latest run is considered a misfire. It is possible to set the maximum number of instances for a particular job that the scheduler will let run concurrently, by using the max_instances keyword argument when adding the job.

所以如果我有:

def test_func(name):
    print('Hello, ' + name)


from apscheduler.schedulers.background import BackgroundScheduler

scheduler = BackgroundScheduler()

scheduler.add_job(test_func, 'date', run_date=date(2021, 12, 24), args=['John'])
scheduler.add_job(test_func, 'date', run_date=date(2021, 12, 24), args=['Mary'])
scheduler.add_job(test_func, 'date', run_date=date(2021, 12, 24), args=['Jack'])

test_func会运行只有一次还是三次?

这些都是不同的时间表(APScheduler 3 术语中的作业),因此它们将同时 运行。