EphemeralTaskList

In-memory task list with a small state machine. Safe to share across coroutines — every public method takes a Mutex internally.

Mirrors the Python reference EphemeralTaskList.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
suspend fun append(description: String): EphemeralTask

Append a new pending task at the tail.

Link copied to clipboard
suspend fun clear(): Int

Remove every task; returns the number of tasks that were cleared.

Link copied to clipboard
suspend fun complete(id: Int): EphemeralTask

Transition the task from TaskStatus.InProgress to TaskStatus.Completed.

Link copied to clipboard
suspend fun insertAfter(existingTaskId: Int, description: String): EphemeralTask

Insert a new pending task immediately after existingTaskId.

Link copied to clipboard
suspend fun list(): List<EphemeralTask>

Snapshot of every task, in current order.

Link copied to clipboard
suspend fun prepend(description: String): EphemeralTask

Prepend a new pending task at the head.

Link copied to clipboard
suspend fun start(id: Int): EphemeralTask

Transition the task from TaskStatus.Pending to TaskStatus.InProgress.