public class WaitStrategyFactory extends Object
WaitStrategy
objects from strings.Constructor and Description |
---|
WaitStrategyFactory() |
Modifier and Type | Method and Description |
---|---|
static com.lmax.disruptor.WaitStrategy |
createWaitStrategyFromString(String waitStrategyType)
Creates a
WaitStrategy from a string. |
public static com.lmax.disruptor.WaitStrategy createWaitStrategyFromString(String waitStrategyType)
WaitStrategy
from a string.
The following strategies are supported:
blocking
- BlockingWaitStrategy
busySpin
- BusySpinWaitStrategy
liteBlocking
- LiteBlockingWaitStrategy
sleeping{retries,sleepTimeNs}
- SleepingWaitStrategy
- retries
an integer number of times to spin before sleeping. (default = 200)
sleepTimeNs
nanosecond time to sleep each iteration after spinning (default = 100)
yielding
- YieldingWaitStrategy
phasedBackoff{spinTimeout,yieldTimeout,timeUnit,fallackStrategy}
- PhasedBackoffWaitStrategy
- spinTimeout
and yieldTimeout
are long values.
timeUnit
is a string name of one of the TimeUnit
values.
fallbackStrategy
is a wait strategy string (e.g. blocking
).
timeoutBlocking{timeout,timeUnit}
- TimeoutBlockingWaitStrategy
- timeout
is a long value.
timeUnit
is a string name of one of the TimeUnit
values.
liteTimeoutBlocking{timeout,timeUnit}
- LiteTimeoutBlockingWaitStrategy
- timeout
is a long value.
timeUnit
is a string name of one of the TimeUnit
values.
waitStrategyType
- the name of the desired wait strategyWaitStrategy
instance or null
if the supplied name is null
or emptyIllegalArgumentException
- if an unknown wait strategy type is given, or the parameters are unable to be parsed.Copyright © 2013–2022. All rights reserved.