inveniosoftware / invenio-records-resources

Records REST APIs for Invenio.
https://invenio-records-resources.readthedocs.io
MIT License
4 stars 49 forks source link

uow: update TaskOp; add TaskRevokeOp #579

Closed yashlamba closed 4 months ago

yashlamba commented 4 months ago

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 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.