now

val now: () -> Long

Parameters

now

A function that provides the current time in milliseconds since epoch (Unix timestamp). Defaults to System.currentTimeMillis. This is used throughout the state plugin for time-based operations such as:

  • Determining if pinned messages have expired (based on pinExpires timestamp)

  • Calculating sync thresholds and time differences

  • Timestamping state updates This parameter primarily exists for testing purposes, allowing tests to inject a controlled time source, but can also be used in production if you need custom time handling (e.g., using a synchronized server time).