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:
BlockingWaitStrategyBusySpinWaitStrategyLiteBlockingWaitStrategySleepingWaitStrategy
- retries an integer number of times to spin before sleeping. (default = 200)
sleepTimeNs nanosecond time to sleep each iteration after spinning (default = 100)
YieldingWaitStrategyPhasedBackoffWaitStrategy
- 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).
TimeoutBlockingWaitStrategy
- timeout is a long value.
timeUnit is a string name of one of the TimeUnit values.
LiteTimeoutBlockingWaitStrategy
- timeout is a long value.
timeUnit is a string name of one of the TimeUnit values.
IllegalArgumentException - if an unknown wait strategy type is given, or the parameters are unable to be parsed.Copyright © 2018. All rights reserved.