httk.store.store_timestamp

Backend-neutral store-managed timestamp helpers.

Attributes

Exceptions

StoreClockRegressionError

A writable store clock is behind its process-local timestamp mark.

Functions

capture_store_timestamp(clock, resolution, mark, *[, ...])

Capture one guarded store-unit timestamp from a nanosecond clock.

advance_store_timestamp_mark(mark, captured, *, ...)

Advance a process-local timestamp high-water mark after a successful save.

encode_store_timestamp_state(enabled, resolution)

Encode the persisted timestamp configuration marker.

parse_store_timestamp_state(value)

Parse a persisted timestamp marker, returning None for unknown values.

ns_operand_to_store_units(value, resolution)

Convert a nanosecond, aware datetime, or RFC3339 string to store units.

Module Contents

httk.store.store_timestamp.FUTURE_TIMESTAMP_SLACK_NS = 2000000000
exception httk.store.store_timestamp.StoreClockRegressionError(mark_ns, clock_ns)

Bases: RuntimeError

A writable store clock is behind its process-local timestamp mark.

httk.store.store_timestamp.capture_store_timestamp(clock, resolution, mark, *, allow_clock_regression=False, clock_regression_grace=True)

Capture one guarded store-unit timestamp from a nanosecond clock.

httk.store.store_timestamp.advance_store_timestamp_mark(mark, captured, *, allow_clock_regression)

Advance a process-local timestamp high-water mark after a successful save.

httk.store.store_timestamp.encode_store_timestamp_state(enabled, resolution)

Encode the persisted timestamp configuration marker.

httk.store.store_timestamp.parse_store_timestamp_state(value)

Parse a persisted timestamp marker, returning None for unknown values.

httk.store.store_timestamp.ns_operand_to_store_units(value, resolution)

Convert a nanosecond, aware datetime, or RFC3339 string to store units.