Skip to content
Playground(another site)

bynk.store.log_needs_clock

Error A handler calls Log.append (which stamps the current time) without declaring given Clock.

Log.append stamps each entry with the time it was written, so it reads the clock and the handler has to declare given Clock. The window reads (since, before, between) take explicit Instants and need no clock. Add given Clock to the handler that appends.

Example

consumes bynk { Clock }
store trail: Log[String]
on call opened() -> Effect[()] {
let _ <- trail.append("opened") // ✗ the stamp reads the clock
Effect.pure(())
}
on call opened() -> Effect[()] given Clock { // ✓ declare the clock
let _ <- trail.append("opened")
Effect.pure(())
}

In the Book

See also

  • Every code in its category, Agent storage, on the diagnostic index.
  • bynk explain bynk.store.log_needs_clock shows the same from the installed toolchain, without a network.