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

    Class Follower

    A reader following one form of logs live (streaming.md, "Following a log"), keeping for each tree the events it holds. form: "kept" (the kept form, or a view made from it) or "live" (the whole log, or a view of it that may show values the kept form lacks); it decides where the reader may resume in place.

    Index
    form: "kept" | "live"
    stopped: boolean = false

    Set once an event of a format it does not know arrived: it follows that source no more.

    • Let a tree go (a finished log a page no longer shows): it keeps nothing of it.

      Parameters

      • tree: string

      Returns void

    • Whether it may resume in place from source (streaming.md, "Resuming"): when the source can give every event it holds as it holds it. Always for the kept form; for a live form, only from the process that gave it every event it holds.

      Parameters

      Returns boolean

    • Take one event, as received. from: which process gave it (a writer's number), or "store"; a live reader's default is the event's writer.

      Parameters

      • e: EventLike
      • opts: { from?: number | "store" } = {}

      Returns FollowResult

    • Read a tree again from a source (after a loss, a reconnection): after its last event when it may resume in place, and from the beginning when it may not or the source answers event-unknown (dropping what it held). Returns the reads it made, in order. A source it can read lets a stopped reader follow again; an event of a format it does not know stops it there (it takes nothing from that event on).

      Parameters

      Returns Promise<{ after: Position | null; answer: ReadAnswer }[]>

    • The replay of what it holds: of one tree, or of every tree it follows.

      Parameters

      • tree: string

      Returns LogState

    • The replay of what it holds: of one tree, or of every tree it follows.

      Returns Record<string, LogState>