Pattern A: Work is performed synchronously.
When you use this pattern, acknowledging work says to Arklow:- I have received the work.
- The work has been done.
- SDK
- HTTP
The handler performs the work, then tells Arklow the work is done.While the handler is open, the client renews the claim’s lease automatically, up to the action timeout. A handler that returns cleanly acks on its own. A handler that fails with an error, or a lease that expires after a crash, will trigger a redelivery.
extend() sends an explicit Modack when you want the deadline moved by a known amount:Pattern B: Work is performed asynchronously.
Arklow allows you to tell it toDefer work. Deferring work tells Arklow:
- I have received the work.
- I will keep telling you I have it.
- Arklow is no longer responsible for redeliveries.
- If I stop telling you I have it, consider it done.
Deferring is to periodically check in with Arklow using Modack.
When using
Defer, missing the Modack lease, or failing to continue doing so results in the work being marked done. For high throughput work, it’s recommended that you don’t rely upon the expiry of the Modack to signal Ack, as this can affect the view of the Admission Controller.- SDK
- HTTP
Hand the work off, then defer the delivery.
After the defer
Any process holding the identifiers settles the action through the ingress API:After using a
Defer, NACK / No Acknowledgement won’t be accepted. Deferring work signals to Arklow that you are taking custody of the work, and will not be expecting redelivery.