LazyStore
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Defined in: src/persistence/LazyStore.ts:39
Lifecycle shared by every store that talks to an external system: lazy first-use connection, one-shot schema preparation, and ownership-aware teardown.
Construction stays synchronous and side-effect-free — new PostgresJournal(…)
must not connect — so the resource opens on the first operation and the
in-flight promise is memoized to keep concurrent first calls to a single
init. Getting that memoization subtly wrong (racing DDL, two pools where one
was intended) is the kind of bug that only shows up under load, which is why
it lives in one place.
TResource is whatever the backend family talks to: a SqlPool for the
relational stores, a database handle plus its client for MongoDB. The base
deliberately knows nothing about it beyond how to prepare and release it.
Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”TResource
Section titled “TResource”TResource
Methods
Section titled “Methods”close()
Section titled “close()”close():
Promise<void>
Defined in: src/persistence/LazyStore.ts:66
Returns
Section titled “Returns”Promise<void>
