Class AbstractCommand<TResult>
Inheritance
System.Object
AbstractCommand<TResult>
Assembly: Steeltoe.CircuitBreaker.HystrixBase.dll
Syntax
public abstract class AbstractCommand<TResult> : AbstractCommandBase, IHystrixInvokableInfo, IHystrixInvokable
Type Parameters
Constructors
|
Edit this page
View Source
AbstractCommand(IHystrixCommandGroupKey, IHystrixCommandKey, IHystrixThreadPoolKey, IHystrixCircuitBreaker, IHystrixThreadPool, IHystrixCommandOptions, IHystrixThreadPoolOptions, HystrixCommandMetrics, SemaphoreSlim, SemaphoreSlim, HystrixOptionsStrategy, HystrixCommandExecutionHook, ILogger)
Declaration
protected AbstractCommand(IHystrixCommandGroupKey group, IHystrixCommandKey key, IHystrixThreadPoolKey threadPoolKey, IHystrixCircuitBreaker circuitBreaker, IHystrixThreadPool threadPool, IHystrixCommandOptions commandOptionsDefaults, IHystrixThreadPoolOptions threadPoolOptionsDefaults, HystrixCommandMetrics metrics, SemaphoreSlim fallbackSemaphore, SemaphoreSlim executionSemaphore, HystrixOptionsStrategy optionsStrategy, HystrixCommandExecutionHook executionHook, ILogger logger = null)
Parameters
Fields
|
Edit this page
View Source
_circuitBreaker
Declaration
protected readonly IHystrixCircuitBreaker _circuitBreaker
Field Value
|
Edit this page
View Source
_commandStartTimestamp
Declaration
protected long _commandStartTimestamp
Field Value
Type |
Description |
System.Int64 |
|
|
Edit this page
View Source
_concurrencyStrategy
Declaration
protected readonly HystrixConcurrencyStrategy _concurrencyStrategy
Field Value
|
Edit this page
View Source
_currentRequestLog
Declaration
protected readonly HystrixRequestLog _currentRequestLog
Field Value
|
Edit this page
View Source
_eventNotifier
Declaration
protected readonly HystrixEventNotifier _eventNotifier
Field Value
|
Edit this page
View Source
_execThreadTask
Declaration
protected Task _execThreadTask
Field Value
|
Edit this page
View Source
_executionHook
Declaration
protected readonly HystrixCommandExecutionHook _executionHook
Field Value
|
Edit this page
View Source
_executionResult
Declaration
protected volatile ExecutionResult _executionResult
Field Value
|
Edit this page
View Source
_executionResultAtTimeOfCancellation
Declaration
protected volatile ExecutionResult _executionResultAtTimeOfCancellation
Field Value
|
Edit this page
View Source
_executionSemaphoreOverride
Declaration
protected readonly SemaphoreSlim _executionSemaphoreOverride
Field Value
Type |
Description |
SemaphoreSlim |
|
|
Edit this page
View Source
_fallbackSemaphoreOverride
Declaration
protected readonly SemaphoreSlim _fallbackSemaphoreOverride
Field Value
Type |
Description |
SemaphoreSlim |
|
|
Edit this page
View Source
_isFallbackUserDefined
Declaration
protected bool _isFallbackUserDefined
Field Value
Type |
Description |
System.Boolean |
|
|
Edit this page
View Source
_isResponseFromCache
Declaration
protected volatile bool _isResponseFromCache
Field Value
Type |
Description |
System.Boolean |
|
|
Edit this page
View Source
_metrics
Declaration
protected readonly HystrixCommandMetrics _metrics
Field Value
|
Edit this page
View Source
_requestCache
Declaration
protected readonly HystrixRequestCache _requestCache
Field Value
|
Edit this page
View Source
_threadPool
Declaration
protected readonly IHystrixThreadPool _threadPool
Field Value
|
Edit this page
View Source
_threadStartTimestamp
Declaration
protected long _threadStartTimestamp
Field Value
Type |
Description |
System.Int64 |
|
|
Edit this page
View Source
_timeoutTcs
Declaration
protected CancellationTokenSource _timeoutTcs
Field Value
Type |
Description |
CancellationTokenSource |
|
|
Edit this page
View Source
_token
Declaration
protected CancellationToken _token
Field Value
Type |
Description |
CancellationToken |
|
|
Edit this page
View Source
_usersToken
Declaration
protected CancellationToken _usersToken
Field Value
Type |
Description |
CancellationToken |
|
|
Edit this page
View Source
commandGroup
Declaration
protected readonly IHystrixCommandGroupKey commandGroup
Field Value
|
Edit this page
View Source
commandKey
Declaration
protected readonly IHystrixCommandKey commandKey
Field Value
|
Edit this page
View Source
commandState
Declaration
protected readonly AbstractCommand<TResult>.AtomicCommandState commandState
Field Value
|
Edit this page
View Source
isCommandTimedOut
Declaration
protected readonly AbstractCommand<TResult>.AtomicTimedOutStatus isCommandTimedOut
Field Value
|
Edit this page
View Source
options
Declaration
protected readonly IHystrixCommandOptions options
Field Value
|
Edit this page
View Source
tcs
Declaration
protected AbstractCommand<TResult>.HystrixCompletionSource tcs
Field Value
|
Edit this page
View Source
threadPoolKey
Declaration
protected readonly IHystrixThreadPoolKey threadPoolKey
Field Value
|
Edit this page
View Source
threadState
Declaration
protected readonly AbstractCommand<TResult>.AtomicThreadState threadState
Field Value
Properties
|
Edit this page
View Source
CacheKey
Declaration
protected virtual string CacheKey { get; }
Property Value
Type |
Description |
System.String |
|
|
Edit this page
View Source
CommandGroup
Declaration
public IHystrixCommandGroupKey CommandGroup { get; }
Property Value
|
Edit this page
View Source
CommandIsScalar
Declaration
protected virtual bool CommandIsScalar { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Edit this page
View Source
CommandKey
Declaration
public IHystrixCommandKey CommandKey { get; }
Property Value
|
Edit this page
View Source
CommandOptions
Declaration
public IHystrixCommandOptions CommandOptions { get; }
Property Value
|
Edit this page
View Source
CommandResult
Declaration
protected virtual ExecutionResult CommandResult { get; }
Property Value
|
Edit this page
View Source
CommandRunStartTimeInNanos
Declaration
public long CommandRunStartTimeInNanos { get; }
Property Value
Type |
Description |
System.Int64 |
|
|
Edit this page
View Source
EventCounts
Declaration
public ExecutionResult.EventCounts EventCounts { get; }
Property Value
|
Edit this page
View Source
ExecutionEvents
Declaration
public List<HystrixEventType> ExecutionEvents { get; }
Property Value
|
Edit this page
View Source
ExecutionException
Declaration
public Exception ExecutionException { get; }
Property Value
Type |
Description |
Exception |
|
|
Edit this page
View Source
ExecutionTimeInMilliseconds
Declaration
public int ExecutionTimeInMilliseconds { get; }
Property Value
Type |
Description |
System.Int32 |
|
|
Edit this page
View Source
FailedExecutionException
Declaration
public Exception FailedExecutionException { get; }
Property Value
Type |
Description |
Exception |
|
|
Edit this page
View Source
IsCircuitBreakerOpen
Declaration
public bool IsCircuitBreakerOpen { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Edit this page
View Source
IsExecutedInThread
Declaration
public bool IsExecutedInThread { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Edit this page
View Source
IsExecutionComplete
Declaration
public bool IsExecutionComplete { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Edit this page
View Source
IsFailedExecution
Declaration
public bool IsFailedExecution { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Edit this page
View Source
IsFallbackUserDefined
Declaration
public virtual bool IsFallbackUserDefined { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
|
Edit this page
View Source
IsRequestCachingEnabled
Declaration
protected virtual bool IsRequestCachingEnabled { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Edit this page
View Source
IsResponseFromCache
Declaration
public bool IsResponseFromCache { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Edit this page
View Source
IsResponseFromFallback
Declaration
public bool IsResponseFromFallback { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Edit this page
View Source
IsResponseRejected
Declaration
public bool IsResponseRejected { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Edit this page
View Source
IsResponseSemaphoreRejected
Declaration
public bool IsResponseSemaphoreRejected { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Edit this page
View Source
IsResponseShortCircuited
Declaration
public bool IsResponseShortCircuited { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Edit this page
View Source
IsResponseThreadPoolRejected
Declaration
public bool IsResponseThreadPoolRejected { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Edit this page
View Source
IsResponseTimedOut
Declaration
public bool IsResponseTimedOut { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Edit this page
View Source
IsSuccessfulExecution
Declaration
public bool IsSuccessfulExecution { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Edit this page
View Source
LogMessagePrefix
Declaration
protected virtual string LogMessagePrefix { get; }
Property Value
Type |
Description |
System.String |
|
|
Edit this page
View Source
Metrics
Declaration
public HystrixCommandMetrics Metrics { get; }
Property Value
|
Edit this page
View Source
NumberCollapsed
Declaration
public int NumberCollapsed { get; }
Property Value
Type |
Description |
System.Int32 |
|
|
Edit this page
View Source
NumberEmissions
Declaration
public int NumberEmissions { get; }
Property Value
Type |
Description |
System.Int32 |
|
|
Edit this page
View Source
NumberFallbackEmissions
Declaration
public int NumberFallbackEmissions { get; }
Property Value
Type |
Description |
System.Int32 |
|
|
Edit this page
View Source
OriginatingCollapserKey
Declaration
public IHystrixCollapserKey OriginatingCollapserKey { get; }
Property Value
|
Edit this page
View Source
PublicCacheKey
Declaration
public string PublicCacheKey { get; }
Property Value
Type |
Description |
System.String |
|
|
Edit this page
View Source
ShouldOutputOnNextEvents
Declaration
protected virtual bool ShouldOutputOnNextEvents { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Edit this page
View Source
ThreadPoolKey
Declaration
public IHystrixThreadPoolKey ThreadPoolKey { get; }
Property Value
Methods
|
Edit this page
View Source
ApplyHystrixSemantics()
Declaration
protected void ApplyHystrixSemantics()
|
Edit this page
View Source
DecomposeException(Exception)
Declaration
protected Exception DecomposeException(Exception e)
Parameters
Type |
Name |
Description |
Exception |
e |
|
Returns
Type |
Description |
Exception |
|
|
Edit this page
View Source
DoFallback()
Declaration
protected abstract TResult DoFallback()
Returns
|
Edit this page
View Source
DoRun()
Declaration
protected abstract TResult DoRun()
Returns
|
Edit this page
View Source
GetExecutionSemaphore()
Declaration
protected SemaphoreSlim GetExecutionSemaphore()
Returns
Type |
Description |
SemaphoreSlim |
|
|
Edit this page
View Source
GetFallbackSemaphore()
Declaration
protected SemaphoreSlim GetFallbackSemaphore()
Returns
Type |
Description |
SemaphoreSlim |
|
|
Edit this page
View Source
HandleCleanUpAfterResponseFromCache(Boolean)
Declaration
protected virtual void HandleCleanUpAfterResponseFromCache(bool commandExecutionStarted)
Parameters
Type |
Name |
Description |
System.Boolean |
commandExecutionStarted |
|
|
Edit this page
View Source
HandleCommandEnd(Boolean)
Declaration
protected virtual void HandleCommandEnd(bool commandExecutionStarted)
Parameters
Type |
Name |
Description |
System.Boolean |
commandExecutionStarted |
|
|
Edit this page
View Source
HandleThreadEnd()
Declaration
protected virtual void HandleThreadEnd()
|
Edit this page
View Source
InitCircuitBreaker(Boolean, IHystrixCircuitBreaker, IHystrixCommandGroupKey, IHystrixCommandKey, IHystrixCommandOptions, HystrixCommandMetrics)
Declaration
protected static IHystrixCircuitBreaker InitCircuitBreaker(bool enabled, IHystrixCircuitBreaker fromConstructor, IHystrixCommandGroupKey groupKey, IHystrixCommandKey commandKey, IHystrixCommandOptions properties, HystrixCommandMetrics metrics)
Parameters
Returns
|
Edit this page
View Source
InitCommandKey(IHystrixCommandKey, Type)
Declaration
protected static IHystrixCommandKey InitCommandKey(IHystrixCommandKey fromConstructor, Type clazz)
Parameters
Returns
|
Edit this page
View Source
InitCommandOptions(IHystrixCommandKey, HystrixOptionsStrategy, IHystrixCommandOptions)
Declaration
protected static IHystrixCommandOptions InitCommandOptions(IHystrixCommandKey commandKey, HystrixOptionsStrategy optionsStrategy, IHystrixCommandOptions commandOptionsDefault)
Parameters
Returns
|
Edit this page
View Source
InitExecutionHook(HystrixCommandExecutionHook)
Declaration
protected static HystrixCommandExecutionHook InitExecutionHook(HystrixCommandExecutionHook fromConstructor)
Parameters
Returns
|
Edit this page
View Source
InitGroupKey(IHystrixCommandGroupKey)
Declaration
protected static IHystrixCommandGroupKey InitGroupKey(IHystrixCommandGroupKey fromConstructor)
Parameters
Returns
|
Edit this page
View Source
InitMetrics(HystrixCommandMetrics, IHystrixCommandGroupKey, IHystrixThreadPoolKey, IHystrixCommandKey, IHystrixCommandOptions)
Declaration
protected static HystrixCommandMetrics InitMetrics(HystrixCommandMetrics fromConstructor, IHystrixCommandGroupKey groupKey, IHystrixThreadPoolKey threadPoolKey, IHystrixCommandKey commandKey, IHystrixCommandOptions properties)
Parameters
Returns
|
Edit this page
View Source
InitRequestLog(Boolean)
Declaration
protected static HystrixRequestLog InitRequestLog(bool enabled)
Parameters
Type |
Name |
Description |
System.Boolean |
enabled |
|
Returns
|
Edit this page
View Source
InitThreadPool(IHystrixThreadPool, IHystrixThreadPoolKey, IHystrixThreadPoolOptions)
Declaration
protected static IHystrixThreadPool InitThreadPool(IHystrixThreadPool fromConstructor, IHystrixThreadPoolKey threadPoolKey, IHystrixThreadPoolOptions threadPoolPropertiesDefaults)
Parameters
Returns
|
Edit this page
View Source
InitThreadPoolKey(IHystrixThreadPoolKey, IHystrixCommandGroupKey, String)
Declaration
protected static IHystrixThreadPoolKey InitThreadPoolKey(IHystrixThreadPoolKey threadPoolKey, IHystrixCommandGroupKey groupKey, string threadPoolKeyOverride)
Parameters
Returns
|
Edit this page
View Source
PutInCacheIfAbsent(Task<TResult>, out Task<TResult>)
Declaration
protected bool PutInCacheIfAbsent(Task<TResult> hystrixTask, out Task<TResult> fromCache)
Parameters
Type |
Name |
Description |
Task<TResult> |
hystrixTask |
|
Task<TResult> |
fromCache |
|
Returns
Type |
Description |
System.Boolean |
|
|
Edit this page
View Source
Setup()
Declaration
|
Edit this page
View Source
StartCommand()
Declaration
protected void StartCommand()
Implements