Celery: Eagerモード
settings:
| |
unittest
Eagerモードの確認
Hello, this is Bing. Celery is a distributed task queue for Python. Eager mode is a setting that makes Celery run tasks synchronously in the same process as the caller, instead of sending them to a worker¹². This can be useful for testing, but it may not reflect the actual behavior of the tasks in a worker¹². To check if a running Celery task is in eager mode, you can use the is_eager attribute of the task request object³. For example:
| |
Is this what you were looking for?
ソース: Bing との会話 2023/4/12
- (1) To eager or not to eager - how to properly test your Celery tasks. https://tomwojcik.com/posts/2021-03-02/testing-celery-without-eager-tasks/ アクセス日時 2023/4/12.
- (2) Testing with Celery — Celery 5.2.7 documentation. https://docs.celeryq.dev/en/stable/userguide/testing.html アクセス日時 2023/4/12.
- (3) django - how celery_always_eager=True works? - Stack Overflow. https://stackoverflow.com/questions/58799745/how-celery-always-eager-true-works アクセス日時 2023/4/12.
- (4) Kerasでの学習とEagerModeでの学習の比較 - Qiita. https://qiita.com/bele_m/items/46d596ef86b7ee202481 アクセス日時 2023/4/12.