Type Alias SemaphoreProviderSettingsBase

SemaphoreProviderSettingsBase: {
    createSlotId?: Invokable<[], string>;
    defaultBlockingInterval?: ITimeSpan;
    defaultBlockingTime?: ITimeSpan;
    defaultRefreshTime?: ITimeSpan;
    defaultTtl?: ITimeSpan | null;
    eventBus?: IEventBus;
    lazyPromiseFactory?: Factory<AsyncLazy<any>, LazyPromise<any>>;
    namespace?: Namespace;
    serde: OneOrMore<ISerderRegister>;
    serdeTransformerName?: string;
}

IMPORT_PATH: "@daiso-tech/core/semaphore"

Type declaration

  • OptionalcreateSlotId?: Invokable<[], string>

    You can pass your slot id generator function.

  • OptionaldefaultBlockingInterval?: ITimeSpan

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

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

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

    TimeSpan.fromMinutes(1);
    
  • OptionaldefaultRefreshTime?: ITimeSpan

    The default refresh time used in the ISemaphore referesh method.

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

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

    TimeSpan.fromMinutes(5);
    
  • OptionaleventBus?: IEventBus
    import { EventBus } from "@daiso-tech/core/event-bus";
    import { MemoryEventBusAdapter } from "@daiso-tech/core/event-bus/adapters";

    new EventBus({
    adapter: new MemoryEventBusAdapter()
    })
  • OptionallazyPromiseFactory?: Factory<AsyncLazy<any>, LazyPromise<any>>

    You can pass a Factory of LazyPromise to configure default settings for all LazyPromise instances used in the SemaphoreProvider class.

    import { LazyPromise } from "@daiso-tech/core/async";

    (invokable) => new LazyPromise(invokable)
  • Optionalnamespace?: Namespace
    import { Namespace } from "@daiso-tech/core/utilities";

    new Namespace(["@", "semaphore"])
  • serde: OneOrMore<ISerderRegister>
  • OptionalserdeTransformerName?: string
    ""