Interface AlarmObject

All Superinterfaces:
DurableObject

public interface AlarmObject extends 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

    Modifier and Type
    Method
    Description
    void
    alarm(DurableState state, Env env)
    The alarm came due.

    Methods inherited from interface dev.gmitch215.bytebox.durable.DurableObject

    fetch
  • Method Details

    • alarm

      void alarm(DurableState state, Env env)
      The alarm came due.
      Parameters:
      state - this instance's storage, alarm and sockets
      env - the bindings