Skip to main content
Acknowledging work is important to letting Arklow trust one of its core signals. There are two main patterns we recommend you use that you can tailor for your own use cases.

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.
In other words, the same block of code/service that receives the work, is also performing and acknowledging the outcome of that work.
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. extend() sends an explicit Modack when you want the deadline moved by a known amount:
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.

Pattern B: Work is performed asynchronously.

Arklow allows you to tell it to Defer 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.
This is useful for long running events that another part of your platform is handling, or would be impractical to handle in the same place as your listener. All that is required after 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.
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.