OptionalcreateLockId?: Invokable<[], string>You can pass your own lock id generator function.
OptionaldefaultRefreshTime?: ITimeSpanThe default refresh time used in the ISharedLock refresh method.
import { TimeSpan } from "@daiso-tech/core/time-span";
TimeSpan.fromMinutes(5);
OptionaldefaultTtl?: ITimeSpan | nullYou can decide the default ttl value for ISharedLock expiration. If null is passed then no ttl will be used by default.
OptionaleventBus?: EventBusInputYou can provide an IEventBus or an IEventBusAdapter instance to handle the component's events.
If you provide an adapter, it will be automatically wrapped in an EventBus instance.
OptionalexecutionContext?: IExecutionContextYou can pass IExecutionContext that will be used by context-aware adapters.
Optionalnamespace?: INamespaceOptionalserde?: OneOrMore<ISerderRegister>You can pass an ISerderRegister instance to the SharedLockFactory to register the shared lock's serialization and deserialization logic for the provided adapter.
OptionalserdeTransformerName?: stringThe serde transformer name used to identify shared-lock serializer and deserializer adapters when there are adapters with the same name.
OptionalwaitUntil?: WaitUntilYou can pass the waitUntil function to handle background promises.
This is required when working with environments like Cloudflare Workers or Vercel Functions to ensure tasks complete after the response is sent.
Base configuration shared by all
SharedLockFactoryvariants.IMPORT_PATH:
"@daiso-tech/core/shared-lock"