functai for TypeScript - v0.1.0
    Preparing search index...

    Class MemoryStore

    Anything that keeps logs for others to read: a journal's store. Each claim and each append is one step per log. A store that cannot take a claim and an append as one step (a compare-and-set) gives no claim.

    Implements

    Index
    • Append one log's events, in order, as one step: kept whole or not at all. Answer "kept", "duplicate" or a refusal. Throwing, rejecting or not answering in time is no answer (the events are sent again); any other answer is a refusal. The events are the store's own copies. signal aborts when the journal stops waiting for this append (its timeout): stop then if you can; a late answer is not read (the writer sends again, and a kept event is then a duplicate).

      Parameters

      • events: readonly Readonly<Rec>[]

      Returns Promise<AppendAnswer>

    • The events kept of a tree, in order.

      Parameters

      • tree: string

      Returns Rec[]

    • Whether a tree's log is finished (its outermost call's end is kept).

      Parameters

      • tree: string

      Returns boolean

    • The last writer number given for a tree (1 before any claim).

      Parameters

      • tree: string

      Returns number