Package dev.gmitch215.bytebox.durable
Interface AlarmObject
- All Superinterfaces:
DurableObject
A Durable Object that takes alarms.
The nearest thing to a scheduled task inside one object. Set the time with
DurableState.setAlarm(long) and the handler runs then, whether or not anyone is connected.
Two things to build around. An invocation carries the same CPU limit as a request, so long work has to re-arm rather than finish in one go. And delivery is at least once: a throw is retried, so a handler that has already done half its work has to be safe to run again.
- Since:
- 1.0.0
-
Method Summary
Methods inherited from interface dev.gmitch215.bytebox.durable.DurableObject
fetch
-
Method Details
-
alarm
The alarm came due.- Parameters:
state- this instance's storage, alarm and socketsenv- the bindings
-