Package com.axelor.workflow.schedule
Class ClaimHeartbeat
java.lang.Object
com.axelor.workflow.schedule.ClaimHeartbeat
- All Implemented Interfaces:
AutoCloseable
Keeps a claim alive while its work runs, so the lease measures whether the holder is alive rather
than how long the work takes. The caller supplies the beat; returning
false means the
claim is gone and stops it.-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static ClaimHeartbeatevery(Duration interval, BooleanSupplier beat) Beat everyintervaluntilbeatreturns false or this is closed; work shorter than one interval never writes.
-
Method Details
-
every
Beat everyintervaluntilbeatreturns false or this is closed; work shorter than one interval never writes. -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-