Table of Contents

Class HystrixCommand<TResult>

Namespace
Steeltoe.CircuitBreaker.Hystrix
Assembly
Steeltoe.CircuitBreaker.HystrixBase.dll
public class HystrixCommand<TResult> : AbstractCommand<TResult>, IHystrixInvokableInfo, IHystrixExecutable<TResult>, IHystrixObservable<TResult>, IHystrixInvokable

Type Parameters

TResult
Inheritance
HystrixCommand<TResult>
Implements
Derived
Inherited Members

Constructors

HystrixCommand(IHystrixCommandGroupKey, IHystrixCommandKey, IHystrixThreadPoolKey, IHystrixCircuitBreaker, IHystrixThreadPool, IHystrixCommandOptions, IHystrixThreadPoolOptions, HystrixCommandMetrics, SemaphoreSlim, SemaphoreSlim, HystrixOptionsStrategy, HystrixCommandExecutionHook, Func<TResult>, Func<TResult>, ILogger)

public HystrixCommand(IHystrixCommandGroupKey group, IHystrixCommandKey key, IHystrixThreadPoolKey threadPoolKey, IHystrixCircuitBreaker circuitBreaker, IHystrixThreadPool threadPool, IHystrixCommandOptions commandOptionsDefaults, IHystrixThreadPoolOptions threadPoolOptionsDefaults, HystrixCommandMetrics metrics, SemaphoreSlim fallbackSemaphore, SemaphoreSlim executionSemaphore, HystrixOptionsStrategy optionsStrategy, HystrixCommandExecutionHook executionHook, Func<TResult> run, Func<TResult> fallback, ILogger logger = null)

Parameters

group IHystrixCommandGroupKey
key IHystrixCommandKey
threadPoolKey IHystrixThreadPoolKey
circuitBreaker IHystrixCircuitBreaker
threadPool IHystrixThreadPool
commandOptionsDefaults IHystrixCommandOptions
threadPoolOptionsDefaults IHystrixThreadPoolOptions
metrics HystrixCommandMetrics
fallbackSemaphore SemaphoreSlim
executionSemaphore SemaphoreSlim
optionsStrategy HystrixOptionsStrategy
executionHook HystrixCommandExecutionHook
run Func<TResult>
fallback Func<TResult>
logger ILogger

HystrixCommand(IHystrixCommandGroupKey, IHystrixThreadPoolKey, Func<TResult>, Func<TResult>, ILogger)

public HystrixCommand(IHystrixCommandGroupKey group, IHystrixThreadPoolKey threadPool, Func<TResult> run = null, Func<TResult> fallback = null, ILogger logger = null)

Parameters

group IHystrixCommandGroupKey
threadPool IHystrixThreadPoolKey
run Func<TResult>
fallback Func<TResult>
logger ILogger

HystrixCommand(IHystrixCommandGroupKey, IHystrixThreadPoolKey, int, Func<TResult>, Func<TResult>, ILogger)

public HystrixCommand(IHystrixCommandGroupKey group, IHystrixThreadPoolKey threadPool, int executionIsolationThreadTimeoutInMilliseconds, Func<TResult> run = null, Func<TResult> fallback = null, ILogger logger = null)

Parameters

group IHystrixCommandGroupKey
threadPool IHystrixThreadPoolKey
executionIsolationThreadTimeoutInMilliseconds int
run Func<TResult>
fallback Func<TResult>
logger ILogger

HystrixCommand(IHystrixCommandGroupKey, Func<TResult>, Func<TResult>, ILogger)

public HystrixCommand(IHystrixCommandGroupKey group, Func<TResult> run = null, Func<TResult> fallback = null, ILogger logger = null)

Parameters

group IHystrixCommandGroupKey
run Func<TResult>
fallback Func<TResult>
logger ILogger

HystrixCommand(IHystrixCommandGroupKey, int, Func<TResult>, Func<TResult>, ILogger)

public HystrixCommand(IHystrixCommandGroupKey group, int executionIsolationThreadTimeoutInMilliseconds, Func<TResult> run = null, Func<TResult> fallback = null, ILogger logger = null)

Parameters

group IHystrixCommandGroupKey
executionIsolationThreadTimeoutInMilliseconds int
run Func<TResult>
fallback Func<TResult>
logger ILogger

HystrixCommand(IHystrixCommandOptions, Func<TResult>, Func<TResult>, ILogger)

public HystrixCommand(IHystrixCommandOptions commandOptions, Func<TResult> run = null, Func<TResult> fallback = null, ILogger logger = null)

Parameters

commandOptions IHystrixCommandOptions
run Func<TResult>
fallback Func<TResult>
logger ILogger

Fields

_fallback

protected readonly Func<TResult> _fallback

Field Value

Func<TResult>

_run

protected readonly Func<TResult> _run

Field Value

Func<TResult>

Methods

DoFallback()

protected override TResult DoFallback()

Returns

TResult

DoRun()

protected override TResult DoRun()

Returns

TResult

Execute()

public TResult Execute()

Returns

TResult

ExecuteAsync()

public Task<TResult> ExecuteAsync()

Returns

Task<TResult>

ExecuteAsync(CancellationToken)

public Task<TResult> ExecuteAsync(CancellationToken token)

Parameters

token CancellationToken

Returns

Task<TResult>

Observe()

public IObservable<TResult> Observe()

Returns

IObservable<TResult>

Observe(CancellationToken)

public IObservable<TResult> Observe(CancellationToken token)

Parameters

token CancellationToken

Returns

IObservable<TResult>

Run()

protected virtual TResult Run()

Returns

TResult

RunAsync()

protected virtual Task<TResult> RunAsync()

Returns

Task<TResult>

RunFallback()

protected virtual TResult RunFallback()

Returns

TResult

RunFallbackAsync()

protected virtual Task<TResult> RunFallbackAsync()

Returns

Task<TResult>

ToObservable()

public IObservable<TResult> ToObservable()

Returns

IObservable<TResult>