Class MonitoringCursor
- Namespace
- Millrace.Storage.Monitoring
- Assembly
- Millrace.dll
The keyset cursor encoding used by the bundled providers, offered publicly so third-party providers get a correct one for free.
public static class MonitoringCursor
- Inheritance
-
MonitoringCursor
- Inherited Members
Remarks
Cursors are opaque to callers (§11.12) — a provider is free to encode its own. This
implementation packs the (CreatedAt, Id) ordering key as big-endian UTC ticks followed by
the id in RFC 4122 byte order, base64url-encoded so it survives a URL path or query string
untouched.
Because the bundled providers share this encoding they will decode one another's cursors. That is harmless: a dashboard is bound to exactly one provider, so a cursor can never legitimately cross between them. What matters is that an undecodable cursor is rejected rather than silently treated as "start from the beginning", which would turn a client bug into an infinite paging loop.
Methods
- CompareIds(Guid, Guid)
Orders ids the way a database orders a uuid column — by RFC 4122 byte order — so the in-memory provider and a relational one agree on the tiebreak.
- Encode(DateTimeOffset, Guid)
Encodes an ordering key into an opaque cursor.
- Encode(DateTimeOffset, string)
Encodes an ordering key whose tiebreak is a consumer-chosen string rather than an id.
- TryDecode(string?, out DateTimeOffset, out Guid)
Decodes a cursor produced by Encode(DateTimeOffset, Guid). Returns false for anything else — malformed, truncated, or simply not a cursor.
- TryDecodeStringId(string?, out DateTimeOffset, out string)
Decodes a cursor produced by Encode(DateTimeOffset, string).