Celery 1.0 Documentation
application. blog/models.py The comment model looks like this: from django.db import models from django.utils.translation import ugettext_lazy as _ class Comment(models.Model): name = models.CharField(_("name") tasks from blog.models import Comment class CommentForm(forms.ModelForm): class Meta: model = Comment def add_comment(request, slug, template_name="comments/create.html"): post = get_object_or_404(Entry run in a timely manner, so please be wary of the state you pass on to tasks. One gotcha is Django model objects. They shouldn’t be passed on as arguments to task classes, it’s almost always better to re-fetch0 码力 | 221 页 | 283.64 KB | 1 年前3Celery 1.0 Documentation
(stable) blog/models.py The comment model looks like this: from django.db import models from django.utils.translation import ugettext_lazy as _ class Comment(models.Model): name = models.CharField(_("name") blog import tasks from blog.models import Comment class CommentForm(forms.ModelForm): class Meta: model = Comment def add_comment(request, slug, template_name="comments/create.html"): post = get_object_or_404(Entry run in a timely manner, so please be wary of the state you pass on to tasks. One gotcha is Django model objects. They shouldn’t be passed on as arguments to task classes, it’s almost always better to re-fetch0 码力 | 123 页 | 400.69 KB | 1 年前3Celery 2.0 Documentation
application. blog/models.py The comment model looks like this: from django.db import models from django.utils.translation import ugettext_lazy as _ class Comment(models.Model): name = models.CharField(_("name") blog import tasks from blog.models import Comment class CommentForm(forms.ModelForm): class Meta: model = Comment def add_comment(request, slug, template_name="comments/create.html"): post = get_object_or_404(Entry run in a timely manner, so please be wary of the state you pass on to tasks. One gotcha is Django model objects. They shouldn’t be passed on as arguments to task classes, it’s almost always better to re-fetch0 码力 | 165 页 | 492.43 KB | 1 年前3Celery 2.0 Documentation
application. blog/models.py The comment model looks like this: from django.db import models from django.utils.translation import ugettext_lazy as _ class Comment(models.Model): name = models.CharField(_("name") tasks from blog.models import Comment class CommentForm(forms.ModelForm): class Meta: model = Comment def add_comment(request, slug, template_name="comments/create.html"): post = get_object_or_404(Entry run in a timely manner, so please be wary of the state you pass on to tasks. One gotcha is Django model objects. They shouldn’t be passed on as arguments to task classes, it’s almost always better to re-fetch0 码力 | 284 页 | 332.71 KB | 1 年前3Celery 2.1 Documentation
Figure 2: Worker bindings. Go to Routing Tasks. Celery takes advantage of AMQPs flexible routing model. Tasks can be routed to specific servers, or a cluster of servers by binding workers to different then it must be the tasks responsibility to assert that, not the callers. Another gotcha is Django model objects. They shouldn’t be passed on as arguments to tasks. It’s almost always better to re-fetch an article and a task that automatically expands some abbreviations in it: class Article(models.Model): title = models.CharField() body = models.TextField() @task def expand_abbreviations(article):0 码力 | 463 页 | 861.69 KB | 1 年前3Celery 2.2 Documentation
limits can be set for each task type, or globally for all. Routing Using AMQP’s flexible routing model you can route tasks to different workers, or select different message topologies, by configuration Figure 2: Worker bindings. Go to Routing Tasks. Celery takes advantage of AMQPs flexible routing model. Tasks can be routed to specific servers, or a cluster of servers by binding workers to different then it must be the tasks responsibility to assert that, not the callers. Another gotcha is Django model objects. They shouldn’t be passed on as arguments to tasks. It’s almost always better to re-fetch0 码力 | 505 页 | 878.66 KB | 1 年前3Celery 2.1 Documentation
Figure 2: Worker bindings. Go to Routing Tasks. Celery takes advantage of AMQPs flexible routing model. Tasks can be routed to specific servers, or a cluster of servers by binding workers to different then it must be the tasks responsibility to assert that, not the callers. Another gotcha is Django model objects. They shouldn’t be passed on as arguments to tasks. It’s almost always better to re-fetch an article and a task that automatically expands some abbreviations in it: class Article(models.Model): title = models.CharField() body = models.TextField() @task def expand_abbreviations(article): article0 码力 | 285 页 | 1.19 MB | 1 年前3Celery 2.3 Documentation
limits can be set for each task type, or globally for all. Routing Using AMQP’s flexible routing model you can route tasks to different workers, or select different message topologies, by configuration Figure 2: Worker bindings. Go to Routing Tasks. Celery takes advantage of AMQPs flexible routing model. Tasks can be routed to specific servers, or a cluster of servers by binding workers to different then it must be the tasks responsibility to assert that, not the callers. Another gotcha is Django model objects. They shouldn’t be passed on as arguments to tasks. It’s almost always better to re-fetch0 码力 | 334 页 | 1.25 MB | 1 年前3Celery 2.2 Documentation
limits can be set for each task type, or globally for all. Routing Using AMQP’s flexible routing model you can route tasks to different workers, or select different message topologies, by configuration Figure 2: Worker bindings. Go to Routing Tasks. Celery takes advantage of AMQPs flexible routing model. Tasks can be routed to specific servers, or a cluster of servers by binding workers to different then it must be the tasks responsibility to assert that, not the callers. Another gotcha is Django model objects. They shouldn’t be passed on as arguments to tasks. It’s almost always better to re-fetch0 码力 | 314 页 | 1.26 MB | 1 年前3Celery 2.3 Documentation
limits can be set for each task type, or globally for all. Routing Using AMQP’s flexible routing model you can route tasks to different workers, or select different message topologies, by configuration Figure 2: Worker bindings. Go to Routing Tasks. Celery takes advantage of AMQPs flexible routing model. Tasks can be routed to specific servers, or a cluster of servers by binding workers to different then it must be the tasks responsibility to assert that, not the callers. Another gotcha is Django model objects. They shouldn’t be passed on as arguments to tasks. It’s almost always better to re-fetch0 码力 | 530 页 | 900.64 KB | 1 年前3
共 51 条
- 1
- 2
- 3
- 4
- 5
- 6