Interface FixedLimitConfig
- All Superinterfaces:
Prototype.Api,Prototype.Factory<FixedLimit>
- All Known Implementing Classes:
FixedLimitConfig.BuilderBase.FixedLimitConfigImpl
Configuration of
FixedLimit.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classFluent API builder forFixedLimit.static classFixedLimitConfig.BuilderBase<BUILDER extends FixedLimitConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends FixedLimitConfig> Fluent API builder base forFixedLimit. -
Method Summary
Modifier and TypeMethodDescriptionstatic FixedLimitConfig.Builderbuilder()Create a new fluent API builder to customize configuration.static FixedLimitConfig.Builderbuilder(FixedLimitConfig instance) Create a new fluent API builder from an existing instance.clock()A clock that supplies nanosecond time.static FixedLimitConfigcreate()Create a new instance with default values.static FixedLimitConfigDeprecated.static FixedLimitConfigCreate a new instance from configuration.booleanWhether to collect metrics for the AIMD implementation.booleanfair()Whether theSemaphoreshould beSemaphore.isFair().name()Name of this instance.intpermits()Number of permit to allow.intHow many requests can be enqueued waiting for a permit.How long to wait for a permit when enqueued.Explicitly configured semaphore.Methods inherited from interface io.helidon.builder.api.Prototype.Factory
build
-
Method Details
-
builder
Create a new fluent API builder to customize configuration.- Returns:
- a new builder
-
builder
Create a new fluent API builder from an existing instance.- Parameters:
instance- an existing instance used as a base for the builder- Returns:
- a builder based on an instance
-
create
Create a new instance from configuration.- Parameters:
config- used to configure the new instance- Returns:
- a new instance configured from configuration
-
create
Deprecated.Create a new instance from configuration.- Parameters:
config- used to configure the new instance- Returns:
- a new instance configured from configuration
-
create
Create a new instance with default values.- Returns:
- a new instance
-
permits
int permits()Number of permit to allow. Defaults to 0. When set to0, we switch to unlimited.- Returns:
- number of permits
-
fair
boolean fair()- Returns:
- whether this should be a fair semaphore
-
queueLength
int queueLength()How many requests can be enqueued waiting for a permit. Note that this may not be an exact behavior due to concurrent invocations. We useSemaphore.getQueueLength()in theFixedLimitimplementation. Default value is 0. If set to {code 0}, there is no queueing.- Returns:
- number of requests to enqueue
-
queueTimeout
Duration queueTimeout()How long to wait for a permit when enqueued. Defaults to "PT1S"- Returns:
- duration of the timeout
-
name
String name()Name of this instance.- Returns:
- name of the instance
-
semaphore
Explicitly configured semaphore. Note that if this is set, all other configuration is ignored.- Returns:
- semaphore instance
-
clock
A clock that supplies nanosecond time.- Returns:
- supplier of current nanoseconds, defaults to
System.nanoTime()
-
enableMetrics
boolean enableMetrics()Whether to collect metrics for the AIMD implementation.- Returns:
- metrics flag
-
create(io.helidon.config.Config)