Celery 3.0 Documentationcom/group/celery-users] and an IRC channel. Here’s one of the simplest applications you can make: from celery import Celery app = Celery('hello', broker='amqp://guest@localhost//') @app.task def hello(): return to import it. In this tutorial we keep everything contained in a single module, but for larger projects you want to create a dedicated module. Let’s create the file tasks.py: from celery import Celery apply_async() method that gives greater control of the task execution (see Calling Tasks): >>> from tasks import add >>> add.delay(4, 4) The task has now been processed by the worker you started earlier, and you0 码力 | 2110 页 | 2.23 MB | 1 年前3
Celery v4.0.0 Documentationcom/group/celery-users] and an IRC channel. Here’s one of the simplest applications you can make: from celery import Celery app = Celery('hello', broker='amqp://guest@localhost//') @app.task def hello(): return to import it. In this tutorial we keep everything contained in a single module, but for larger projects you want to create a dedicated module. Let’s create the file tasks.py: from celery import Celery apply_async() method that gives greater control of the task execution (see Calling Tasks): >>> from tasks import add >>> add.delay(4, 4) The task has now been processed by the worker you started earlier, and you0 码力 | 2106 页 | 2.23 MB | 1 年前3
Celery v5.0.0 Documentationcom/group/celery-users] and an IRC channel. Here’s one of the simplest applications you can make: from celery import Celery app = Celery('hello', broker='amqp://guest@localhost//') @app.task def hello(): return and encode the password so it can always be parsed correctly. For example: from kombu.utils.url import safequote aws_access_key = safequote("ABCDEFGHIJKLMNOPQRST") aws_secret_key = safequote("ZYXK7N to import it. In this tutorial we keep everything contained in a single module, but for larger projects you want to create a dedicated module. Let’s create the file tasks.py: from celery import Celery0 码力 | 2309 页 | 2.13 MB | 1 年前3
Celery v5.0.5 Documentationcom/group/celery-users] and an IRC channel. Here’s one of the simplest applications you can make: from celery import Celery app = Celery('hello', broker='amqp://guest@localhost//') @app.task def hello(): return and encode the password so it can always be parsed correctly. For example: from kombu.utils.url import safequote aws_access_key = safequote("ABCDEFGHIJKLMNOPQRST") aws_secret_key = safequote("ZYXK7N to import it. In this tutorial we keep everything contained in a single module, but for larger projects you want to create a dedicated module. Let’s create the file tasks.py: from celery import Celery0 码力 | 2315 页 | 2.14 MB | 1 年前3
Celery v5.0.1 Documentationcom/group/celery-users] and an IRC channel. Here’s one of the simplest applications you can make: from celery import Celery app = Celery('hello', broker='amqp://guest@localhost//') @app.task def hello(): return and encode the password so it can always be parsed correctly. For example: from kombu.utils.url import safequote aws_access_key = safequote("ABCDEFGHIJKLMNOPQRST") aws_secret_key = safequote("ZYXK7N to import it. In this tutorial we keep everything contained in a single module, but for larger projects you want to create a dedicated module. Let’s create the file tasks.py: from celery import Celery0 码力 | 2313 页 | 2.13 MB | 1 年前3
Celery v5.0.2 Documentationcom/group/celery-users] and an IRC channel. Here’s one of the simplest applications you can make: from celery import Celery app = Celery('hello', broker='amqp://guest@localhost//') @app.task def hello(): return and encode the password so it can always be parsed correctly. For example: from kombu.utils.url import safequote aws_access_key = safequote("ABCDEFGHIJKLMNOPQRST") aws_secret_key = safequote("ZYXK7N to import it. In this tutorial we keep everything contained in a single module, but for larger projects you want to create a dedicated module. Let’s create the file tasks.py: from celery import Celery0 码力 | 2313 页 | 2.14 MB | 1 年前3
Celery 3.1 Documentationmailing-list and an IRC channel. Here’s one of the simplest applications you can make: from celery import Celery app = Celery('hello', broker='amqp://guest@localhost//') @app.task def hello(): return Release 3.1.25 Configuration First, you’ll need to import the iron_celery library right after you import Celery, for example: from celery import Celery import iron_celery app = Celery('mytasks', broker='ironmq://' do in Celery, like creating tasks and managing workers, it must be possible for other modules to import it. In this tutorial you will keep everything contained in a single module, but for larger projects0 码力 | 607 页 | 2.27 MB | 1 年前3
Celery 3.1 Documentationcom/group/celery-users] and an IRC channel. Here’s one of the simplest applications you can make: from celery import Celery app = Celery('hello', broker='amqp://guest@localhost//') @app.task def hello(): return iron.io). Configuration First, you’ll need to import the iron_celery library right after you import Celery, for example: from celery import Celery import iron_celery app = Celery('mytasks', broker='ironmq://' do in Celery, like creating tasks and managing workers, it must be possible for other modules to import it. In this tutorial you will keep everything contained in a single module, but for larger projects0 码力 | 887 页 | 1.22 MB | 1 年前3
Celery 2.5 Documentationprobably want to see some code by now, so here’s an example task adding two numbers: from celery.task import task @task def add(x, y): return x + y You can execute the task in the background, or wait for convention we will call our module tasks.py, and it looks like this: file tasks.py from celery.task import task @task def add(x, y): return x + y Behind the scenes the @task decorator actually creates a related options see Task result backend settings. 3. Finally we list the modules the worker should import. This includes the modules containing your tasks. We only have a single task module, tasks.py, which0 码力 | 400 页 | 1.40 MB | 1 年前3
Celery 2.3 Documentationprobably want to see some code by now, so here’s an example task adding two numbers: from celery.task import task @task def add(x, y): return x + y You can execute the task in the background, or wait for convention we will call our module tasks.py, and it looks like this: file tasks.py from celery.task import task @task def add(x, y): return x + y Behind the scenes the @task decorator actually creates a related options see Task result backend settings. 3. Finally we list the modules the worker should import. This includes the modules containing your tasks. We only have a single task module, tasks.py, which0 码力 | 334 页 | 1.25 MB | 1 年前3
共 51 条
- 1
- 2
- 3
- 4
- 5
- 6













