C# Class EducationPathways.ServiceBus.DynamicThrottling

Provides a way to throttle the work depending on the number of jobs it is able to complete and whether the job is penalized for trying to parallelize too many jobs.
Inheritance: IDisposable
ファイルを表示 Open project: pebblecode/EducationPathways Class Usage Examples

Public Methods

Method Description
Dispose ( ) : void
DynamicThrottling ( int maxDegreeOfParallelism, int minDegreeOfParallelism, int penaltyAmount, int workFailedPenaltyAmount, int workCompletedParallelismGain, int intervalForRestoringDegreeOfParallelism ) : System

Initializes a new instance of DynamicThrottling.

NotifyWorkCompleted ( ) : void
NotifyWorkCompletedWithError ( ) : void
NotifyWorkStarted ( ) : void
Penalize ( ) : void
Start ( CancellationToken cancellationToken ) : void
WaitUntilAllowedParallelism ( CancellationToken cancellationToken ) : void

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Private Methods

Method Description
DecrementDegreesOfParallelism ( int count ) : void
IncrementDegreesOfParallelism ( int count ) : void

Method Details

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void

DynamicThrottling() public method

Initializes a new instance of DynamicThrottling.
public DynamicThrottling ( int maxDegreeOfParallelism, int minDegreeOfParallelism, int penaltyAmount, int workFailedPenaltyAmount, int workCompletedParallelismGain, int intervalForRestoringDegreeOfParallelism ) : System
maxDegreeOfParallelism int Maximum number of parallel jobs.
minDegreeOfParallelism int Minimum number of parallel jobs.
penaltyAmount int Number of degrees of parallelism to remove when penalizing slightly.
workFailedPenaltyAmount int Number of degrees of parallelism to remove when work fails.
workCompletedParallelismGain int Number of degrees of parallelism to restore on work completed.
intervalForRestoringDegreeOfParallelism int Interval in milliseconds to restore 1 degree of parallelism.
return System

NotifyWorkCompleted() public method

public NotifyWorkCompleted ( ) : void
return void

NotifyWorkCompletedWithError() public method

public NotifyWorkCompletedWithError ( ) : void
return void

NotifyWorkStarted() public method

public NotifyWorkStarted ( ) : void
return void

Penalize() public method

public Penalize ( ) : void
return void

Start() public method

public Start ( CancellationToken cancellationToken ) : void
cancellationToken System.Threading.CancellationToken
return void

WaitUntilAllowedParallelism() public method

public WaitUntilAllowedParallelism ( CancellationToken cancellationToken ) : void
cancellationToken System.Threading.CancellationToken
return void