Type Alias LockProviderFactorySettings<TAdapters>

LockProviderFactorySettings<TAdapters>: {
    adapters: LockAdapters<TAdapters>;
    backoffPolicy?: BackoffPolicy | null;
    createOwnerId?: (() => string);
    defaultAdapter?: NoInfer<TAdapters>;
    defaultBlockingInterval?: TimeSpan;
    defaultBlockingTime?: TimeSpan;
    defaultRefreshTime?: TimeSpan;
    defaultTtl?: TimeSpan | null;
    eventBus?: IGroupableEventBus<any>;
    retryAttempts?: number | null;
    retryPolicy?: RetryPolicy | null;
    serde: OneOrMore<IFlexibleSerde>;
    shouldRegisterErrors?: boolean;
    shouldRegisterEvents?: boolean;
    timeout?: TimeSpan | null;
}

IMPORT_PATH: "@daiso-tech/core/lock/implementations/derivables"

Type Parameters

  • TAdapters extends string

Type declaration

  • adapters: LockAdapters<TAdapters>
  • OptionalbackoffPolicy?: BackoffPolicy | null

    The default backof policy to use in the returned LazyPromise.

    {null}
    
  • OptionalcreateOwnerId?: (() => string)

    You can pass your owner id generator function.

      • (): string
      • Returns string

  • OptionaldefaultAdapter?: NoInfer<TAdapters>
  • OptionaldefaultBlockingInterval?: TimeSpan

    The default refresh time used in the ILock acquireBlocking and runBlocking methods.

    TimeSpan.fromSeconds(1);
    
  • OptionaldefaultBlockingTime?: TimeSpan

    The default refresh time used in the ILock acquireBlocking and runBlocking methods.

    TimeSpan.fromMinutes(1)
    
  • OptionaldefaultRefreshTime?: TimeSpan

    The default refreshtime used in the ILock extend method.

    TimeSpan.fromMinutes(5);
    
  • OptionaldefaultTtl?: TimeSpan | null

    You can decide the default ttl value for ILock expiration. If null is passed then no ttl will be used by default.

    TimeSpan.fromMinutes(5);
    
  • OptionaleventBus?: IGroupableEventBus<any>
    new EventBus({
    adapter: new MemoryEventBusAdapter({
    rootGroup: "@global"
    })
    })
  • OptionalretryAttempts?: number | null

    The default retry attempt to use in the returned LazyPromise.

    {null}
    
  • OptionalretryPolicy?: RetryPolicy | null

    The default retry policy to use in the returned LazyPromise.

    {null}
    
  • serde: OneOrMore<IFlexibleSerde>

    You can pass one or more IFlexibleSerde that will be used to register all ILock related errors and events.

    {true}
    
  • OptionalshouldRegisterErrors?: boolean

    If set to true, all ILock related errors will be registered with the specified IFlexibleSerde during constructor initialization. This ensures that all ILock related errors will be serialized correctly.

    {true}
    
  • OptionalshouldRegisterEvents?: boolean

    If set to true, all ILock related events will be registered with the specified IFlexibleSerde during constructor initialization. This ensures that all ILock related events will be serialized correctly.

    {true}
    
  • Optionaltimeout?: TimeSpan | null

    The default timeout to use in the returned LazyPromise.

    {null}