Skip to main content
Version: Current

CloseTarget

@rotorsoft/act-root


@rotorsoft/act-root / act/src / CloseTarget

Type Alias: CloseTarget

CloseTarget = object

Defined in: libs/act/src/types/action.ts:794

Per-stream options for the archive-and-truncate (or restart-with- snapshot) operation.

Seeโ€‹

IAct.close for the close-the-books API

Propertiesโ€‹

archive?โ€‹

readonly optional archive?: () => Promise<void>

Defined in: libs/act/src/types/action.ts:807

Called before truncation while the stream is guarded (no concurrent writes). Use app.query() or app.query_array() inside for pagination. If it throws, the stream remains guarded but is not truncated. On a windowed close (before set) there is no guard โ€” the callback archives the immutable pre-cutoff prefix, which concurrent appends cannot change.

Returnsโ€‹

Promise<void>


before?โ€‹

readonly optional before?: Date

Defined in: libs/act/src/types/action.ts:815

Windowed close: prune events older than this cutoff instead of closing the stream. The store deletes the prefix below the closest safe __snapshot__ (created < before, capped at the min consumer watermark) and keeps the snapshot + tail โ€” no tombstone, no seed, and the stream keeps accepting actions. No qualifying snapshot โ‡’ the stream is skipped this cycle. Mutually exclusive with restart.


restart?โ€‹

readonly optional restart?: boolean

Defined in: libs/act/src/types/action.ts:800

When true, restart with a __snapshot__ of the final state. When false/omitted, permanently close with a __tombstone__. Mutually exclusive with before.


streamโ€‹

readonly stream: string

Defined in: libs/act/src/types/action.ts:796

Stream name to close