Function withLockPrefix

  • Creates a plugin that prefixes all keys passed to a lock adapter.

    Every method that accepts a lock key will have the given prefix prepended before the call is forwarded to the underlying adapter. This is useful for namespacing locks when multiple independent consumers share the same lock backend.

    Parameters

    • prefix: string

      The string to prepend to every lock key.

    Returns PluginFn<ILockAdapter>

    A middleware plugin that wraps an ILockAdapter.

    IMPORT_PATH: "@daiso-tech/core/lock/plugins"