OptionalcreateLockId?: Invokable<[], string>You can pass your own lock id generator function.
OptionaldefaultRefreshTime?: ITimeSpanThe default refresh time used in the ILock refresh method.
import { TimeSpan } from "@daiso-tech/core/time-span";
TimeSpan.fromMinutes(5);
OptionaldefaultTtl?: ITimeSpan | nullYou can decide the default ttl value for ILock 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 LockFactory to register the lock's serialization and deserialization logic for the provided adapter.
OptionalserdeTransformerName?: stringThe registered serde transformer name used to identify 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
LockFactoryvariants.IMPORT_PATH:
"@daiso-tech/core/lock"