Earlier TaskOp used the Celery task delay method, so the signature of init was with respect to delay. However, now we also want to pass execution options which are only possible through apply_async (Ref for the signature difference: https://docs.celeryq.dev/en/stable/userguide/calling.html#example).
The for_apply_async receives apply_async compatible arguments and returns a valid TaskOp while using TaskOp directly will support the existing signature of delay, for backwards compatibility.
closes https://github.com/inveniosoftware/invenio-jobs/issues/6 (edited by @alejandromumo 🥷)
Earlier
TaskOp
used the Celery task delay method, so the signature of init was with respect to delay. However, now we also want to pass execution options which are only possible throughapply_async
(Ref for the signature difference: https://docs.celeryq.dev/en/stable/userguide/calling.html#example).The
for_apply_async
receivesapply_async
compatible arguments and returns a validTaskOp
while usingTaskOp
directly will support the existing signature ofdelay
, for backwards compatibility.