Hystrix: Latency and Fault Tolerance for Distributed Systems



com.netflix.hystrix.strategy.concurrency
Interface HystrixRequestVariable<T>

Type Parameters:
T - Type to be stored on the HystrixRequestVariable
All Superinterfaces:
HystrixRequestVariableLifecycle<T>

public interface HystrixRequestVariable<T>
extends HystrixRequestVariableLifecycle<T>

Interface for a variable similar to ThreadLocal but scoped at the user request level.

Default implementation is HystrixRequestVariableDefault managed by HystrixRequestContext.

Custom implementations can be injected using HystrixPlugins and HystrixConcurrencyStrategy.getRequestVariable(com.netflix.hystrix.strategy.concurrency.HystrixRequestVariableLifecycle).

See JavaDoc of HystrixRequestContext for more information about functionality this enables and how to use the default implementation.


Method Summary
 T get()
          Retrieve current value or initialize and then return value for this variable for the current request scope.
 
Methods inherited from interface com.netflix.hystrix.strategy.concurrency.HystrixRequestVariableLifecycle
initialValue, shutdown
 

Method Detail

get

T get()
Retrieve current value or initialize and then return value for this variable for the current request scope.

Returns:
T value of variable for current request scope.