- class swh.scheduler.task.SWHTask
a schedulable task (abstract class)
Current implementation is based on Celery. See http://docs.celeryproject.org/en/latest/reference/celery.app.task.html for how to use tasks once instantiated
- reject_on_worker_lost = None
celery.app.task.Task, but we need to override its docstring because it uses a custom ReST role
- property statsd
- on_failure(exc, task_id, args, kwargs, einfo)
This is run by the worker when the task fails.
The return value of this handler is ignored.
- Return type
- on_success(retval, task_id, args, kwargs)
Run by the worker if the task executes successfully.
- property log
- ignore_result = False
If enabled the worker won’t store task state and return values for this task. Defaults to the
- priority = None
Default task priority.
- rate_limit = None
None(no rate limit), ‘100/s’ (hundred tasks a second), ‘100/m’ (hundred tasks a minute),`’100/h’` (hundred tasks an hour)
Rate limit for this task type. Examples
- request_stack = <celery.utils.threads._LocalStack object>
Task request stack, the current request will be the topmost.
- run(*args, **kwargs)
The body of the task executed by workers.
- serializer = 'msgpack'
The name of a serializer that are registered with
kombu.serialization.registry. Default is ‘json’.
- store_errors_even_if_ignored = False
When enabled errors will be stored even if the task is otherwise configured to ignore results.
- track_started = True
If enabled the task will report its status as ‘started’ when the task is executed by a worker. Disabled by default as the normal behavior is to not report that level of granularity. Tasks are either pending, finished, or waiting to be retried.
Having a ‘started’ status can be useful for when there are long running tasks and there’s a need to report what task is currently running.
The application default can be overridden using the
- typing = True
Enable argument checking. You can set this to false if you don’t want the signature to be checked when calling the task. Defaults to