MutationRecord

@Serializable
data class MutationRecord(val id: String, val key: String, val codecId: String, val payload: String, val enqueuedAtMillis: Long)

The fully serializable snapshot of one enqueued mutation that a MutationStore persists.

This is the payoff of QueuedMutation not being a raw closure: every field here is a plain string/number, so a durable MutationStore implementation can write it straight to disk (a MutationRecord is @Serializable, so Json.encodeToString/SQLDelight/Room/DataStore all work without extra glue) and hand it back unchanged after the process restarts. MutationQueue reconstructs the executable QueuedMutation from a record via the MutationCodec identified by codecId.

Constructors

Link copied to clipboard
constructor(id: String, key: String, codecId: String, payload: String, enqueuedAtMillis: Long)

Properties

Link copied to clipboard

the MutationCodec.id that can decode payload back into an endpoint + body.

Link copied to clipboard

wall-clock time the mutation was (re-)enqueued, for diagnostics/ordering.

Link copied to clipboard
val id: String

a unique id for this specific enqueue (regenerated each time coalescing replaces it).

Link copied to clipboard
val key: String

the MutationKey.value this record coalesces under.

Link copied to clipboard

the codec-produced encoding of the endpoint + body to replay.