Class InMemoryFullCacheStubCacheAdapter<TFields>

A cache adapter is an interface by which objects can be cached, fetched from cache, and removed from cache (invalidated).

Type Parameters

  • TFields

Hierarchy

  • InMemoryFullCacheStubCacheAdapter

Implements

Constructors

Properties

cache: Map<string, Readonly<TFields>>
entityConfiguration: EntityConfiguration<TFields>

Methods

  • Negatively cache objects that could not be found in the cache or DB.

    Type Parameters

    • N extends string | number | symbol

    Parameters

    • _fieldName: N

      object field being queried

    • _fieldValues: readonly NonNullable<TFields[N]>[]

      fieldValues for objects reported as CacheStatus.NEGATIVE in the cache and not found in the DB.

    Returns Promise<void>

  • Cache many objects fetched from the DB.

    Type Parameters

    • N extends string | number | symbol

    Parameters

    • fieldName: N

      object field being queried

    • objectMap: ReadonlyMap<NonNullable<TFields[N]>, Readonly<TFields>>

      map from field value to object to cache

    Returns Promise<void>

  • Load many objects from cache.

    Type Parameters

    • N extends string | number | symbol

    Parameters

    • fieldName: N

      object field being queried

    • fieldValues: readonly NonNullable<TFields[N]>[]

      fieldName field values being queried

    Returns Promise<ReadonlyMap<NonNullable<TFields[N]>, CacheLoadResult<TFields>>>

    map from all field values to a CacheLoadResult for each input value

Generated using TypeDoc