|
@@ -237,7 +237,8 @@ advanced features of celery later.
|
|
|
This is a task that basically does nothing but take some arguments,
|
|
|
and return a value:
|
|
|
|
|
|
- >>> from celery.task import Task, tasks
|
|
|
+ >>> from celery.task import Task
|
|
|
+ >>> from celery.registry import tasks
|
|
|
>>> class MyTask(Task):
|
|
|
... name = "myapp.mytask"
|
|
|
... def run(self, some_arg, **kwargs):
|
|
@@ -296,7 +297,8 @@ Periodic Tasks
|
|
|
Periodic tasks are tasks that are run every ``n`` seconds.
|
|
|
Here's an example of a periodic task:
|
|
|
|
|
|
- >>> from celery.task import tasks, PeriodicTask
|
|
|
+ >>> from celery.task import PeriodicTask
|
|
|
+ >>> from celery.registry import tasks
|
|
|
>>> from datetime import timedelta
|
|
|
>>> class MyPeriodicTask(PeriodicTask):
|
|
|
... name = "foo.my-periodic-task"
|