SyncEngine

class SyncEngine @JvmOverloads constructor(context: Context, cfgProvider: () -> KioskOpsConfig, queue: QueueRepository, transport: Transport, logs: RingLog, telemetry: TelemetrySink, audit: PersistentAuditTrail, clock: Clock, onDelivery: (EventDelivery) -> Unit = {})

Fleet-ops sync engine.

Design goals:

  • host-controlled transport (auth headers, data residency)

  • idempotent server contract (id + idempotencyKey)

  • explicit transient vs permanent error classification

  • local-only observability (telemetry/audit) without sending PII

Ordering guarantee: Events within a single batch are delivered in enqueue order. However, if a batch fails and is retried, a newer batch may be delivered before the retried batch. Consumers that require strict global ordering should implement server-side sequence checks using com.sarastarquant.kioskops.sdk.queue.QueueEventEntity.createdAtEpochMs.

Constructors

Link copied to clipboard
constructor(context: Context, cfgProvider: () -> KioskOpsConfig, queue: QueueRepository, transport: Transport, logs: RingLog, telemetry: TelemetrySink, audit: PersistentAuditTrail, clock: Clock, onDelivery: (EventDelivery) -> Unit = {})

Functions

Link copied to clipboard

Send one batch. Calls are serialized: a second caller waits until the first finishes, so audit checkpoints reach the server in the order the device created them.