append

fun append(stored: String?, checkpoint: Checkpoint<State>, maxHistory: Int = Int.MAX_VALUE): String

Returns the history stored with checkpoint added, for a Checkpointer that keeps the checkpoints of a thread in one string. checkpoint replaces the checkpoints with its step or a later one, as Checkpointer.save asks, and of the result the last maxHistory are kept.

The states of the stored checkpoints are not read. A line of stored that is not a checkpoint is left out, so that a damaged history does not stop a run from being saved.

Parameters

stored

what append or encode returned before, or null for a thread without checkpoints.

maxHistory

how many checkpoints to keep, counted from the latest.