Interface IHystrixCommand
Assembly: Hystrix.Dotnet.dll
Syntax
public interface IHystrixCommand
Properties
|
Improve this Doc
View Source
CircuitBreaker
Returns the internal circuit breaker
Declaration
IHystrixCircuitBreaker CircuitBreaker { get; }
Property Value
|
Improve this Doc
View Source
CommandIdentifier
Declaration
HystrixCommandIdentifier CommandIdentifier { get; }
Property Value
|
Improve this Doc
View Source
CommandMetrics
Declaration
IHystrixCommandMetrics CommandMetrics { get; }
Property Value
|
Improve this Doc
View Source
ConfigurationService
Declaration
IHystrixConfigurationService ConfigurationService { get; }
Property Value
|
Improve this Doc
View Source
ThreadPoolMetrics
Declaration
IHystrixThreadPoolMetrics ThreadPoolMetrics { get; }
Property Value
Methods
|
Improve this Doc
View Source
Execute<T>(Func<T>, Func<T>, CancellationTokenSource)
Runs the synchronous primaryFunction
wrapped by circuit breaker and timeout pattern, with a fallback function; an error, timeout or open circuit breaker will execute the fallbackFunction
Declaration
T Execute<T>(Func<T> primaryFunction, Func<T> fallbackFunction, CancellationTokenSource cancellationTokenSource = null)
Parameters
Type |
Name |
Description |
System.Func<T> |
primaryFunction |
|
System.Func<T> |
fallbackFunction |
|
System.Threading.CancellationTokenSource |
cancellationTokenSource |
|
Returns
Type Parameters
|
Improve this Doc
View Source
Execute<T>(Func<T>, CancellationTokenSource)
Runs the synchronous primaryFunction
wrapped by circuit breaker and timeout pattern, without a fallback; an error, timeout or open circuit breaker will result in a HystrixCommandException
Declaration
T Execute<T>(Func<T> primaryFunction, CancellationTokenSource cancellationTokenSource = null)
Parameters
Type |
Name |
Description |
System.Func<T> |
primaryFunction |
The operation to execute.
|
System.Threading.CancellationTokenSource |
cancellationTokenSource |
The cancellation token source.
|
Returns
Type Parameters
|
Improve this Doc
View Source
ExecuteAsync<T>(Func<Task<T>>, Func<Task<T>>, CancellationTokenSource)
Runs the asynchronous primaryFunction
wrapped by circuit breaker and timeout pattern, with a fallback function; an error, timeout or open circuit breaker will execute the fallbackFunction
Declaration
Task<T> ExecuteAsync<T>(Func<Task<T>> primaryFunction, Func<Task<T>> fallbackFunction, CancellationTokenSource cancellationTokenSource = null)
Parameters
Type |
Name |
Description |
System.Func<System.Threading.Tasks.Task<T>> |
primaryFunction |
|
System.Func<System.Threading.Tasks.Task<T>> |
fallbackFunction |
|
System.Threading.CancellationTokenSource |
cancellationTokenSource |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<T> |
|
Type Parameters
|
Improve this Doc
View Source
ExecuteAsync<T>(Func<Task<T>>, CancellationTokenSource)
Runs the asynchronous primaryFunction
wrapped by circuit breaker and timeout pattern, without a fallback; an error, timeout or open circuit breaker will result in a HystrixCommandException
Declaration
Task<T> ExecuteAsync<T>(Func<Task<T>> primaryFunction, CancellationTokenSource cancellationTokenSource = null)
Parameters
Type |
Name |
Description |
System.Func<System.Threading.Tasks.Task<T>> |
primaryFunction |
|
System.Threading.CancellationTokenSource |
cancellationTokenSource |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<T> |
|
Type Parameters