DataStoreTaskBridgeCheckpointStore

An implementation of TaskBridgeCheckpointStore using Android Jetpack DataStore (Preferences).

This provides persistent storage for task checkpoints across app restarts.

Parameters

file

The file location where DataStore will persist data.

scope

CoroutineScope for DataStore internal operations.

Constructors

Link copied to clipboard
constructor(file: File, scope: CoroutineScope)

Functions

Link copied to clipboard
open suspend override fun clear(key: String)

Removes the checkpoint associated with the given key. Called when a task reaches a terminal state.

Link copied to clipboard
open suspend override fun load(key: String): String?

Loads the last event ID for the given key.

Link copied to clipboard
open suspend override fun save(key: String, lastEventId: String)

Persists the lastEventId for the given key.