• Preparing search index...
  • The search index is not available
@daiso-tech/core - v0.56.0
  • @daiso-tech/core
  • SharedLock
  • withSharedLockFactory

Function withSharedLockFactory

  • withSharedLockFactory(
        sharedLockFactory: ISharedLockFactory,
    ): <TParameters extends unknown[], TReturn>(
        settings: WithSharedLockFactorySettings<TParameters>,
    ) => MiddlewareFn<TParameters, Promise<TReturn>>
  • Creates a middleware factory that wraps function calls with a distributed shared lock (reader-writer lock).

    When the when setting is "READER" multiple callers can execute the wrapped function concurrently. When "WRITER" the caller gets exclusive access — no other reader or writer can hold the lock at the same time.

    Parameters

    • sharedLockFactory: ISharedLockFactory

      The shared-lock factory to use.

    Returns <TParameters extends unknown[], TReturn>(
        settings: WithSharedLockFactorySettings<TParameters>,
    ) => MiddlewareFn<TParameters, Promise<TReturn>>

    A function that accepts WithSharedLockFactorySettings and returns a middleware.

    IMPORT_PATH: "@daiso-tech/core/shared-lock/middlewares"

    • Defined in src/shared-lock/implementations/middlewares/with-shared-lock/with-shared-lock-factory.ts:103

Settings

Member Visibility
@daiso-tech/core - v0.56.0
  • Loading...

Generated using TypeDoc