default
Default task execution strategy.
def default(
task: celery.app.task.Task,
app: celery.Celery,
consumer: celery.worker.consumer.Consumer,
info: callable = logger.info,
error: callable = logger.error,
task_reserved: callable = task_reserved,
to_system_tz: callable = timezone.to_system,
bytes: type = bytes,
proto1_to_proto2: callable = proto1_to_proto2
) - > function
Default task execution strategy. Note: Strategies are here as an optimization, so sadly it's not very easy to override.
Parameters
| Name | Type | Description |
|---|---|---|
| task | celery.app.task.Task | The task instance for which this execution strategy is being generated. |
| app | celery.Celery | The Celery application instance providing configuration and timezone settings. |
| consumer | celery.worker.consumer.Consumer | The worker consumer instance responsible for managing the connection, timer, and task buckets. |
| info | callable = logger.info | Logging function used to record task receipt and metadata. |
| error | callable = logger.error | Logging function used to record errors during ETA conversion or processing. |
| task_reserved | callable = task_reserved | Callback triggered when a task is officially reserved by the worker. |
| to_system_tz | callable = timezone.to_system | Utility function to convert UTC datetimes to the local system timezone. |
| bytes | type = bytes | The bytes type used for message body handling. |
| proto1_to_proto2 | callable = proto1_to_proto2 | Converter function to translate legacy Celery protocol 1 messages to protocol 2. |
Returns
| Type | Description |
|---|---|
function | A closure (task_message_handler) that processes incoming AMQP messages for the specific task, handling decoding, ETA scheduling, and rate limiting. |