Summer.Batch.Infrastructure.Repeat.Support.TaskExecutorRepeatTemplate Class Reference

Support for RepeatOperations, including interceptors (used to modify or monitor the behavior at run time). Thread-safe class, provided that its collaborators are thread-safe as well. More...

Inheritance diagram for Summer.Batch.Infrastructure.Repeat.Support.TaskExecutorRepeatTemplate:
Summer.Batch.Infrastructure.Repeat.Support.RepeatTemplate Summer.Batch.Infrastructure.Repeat.IRepeatOperations

Public Attributes

const int DefaultThrottleLimit = 4
 Default limit for maximum number of concurrent unfinished results allowed by the template. More...
 

Protected Member Functions

override IRepeatInternalState CreateInternalState (IRepeatContext context)
 see RepeatTemplate::CreateInternalState . More...
 
override RepeatStatus GetNextResult (IRepeatContext context, RepeatCallback callback, IRepeatInternalState state)
 Use the TaskExecutor to generate a result. The internal state in this case is a queue of unfinished result holders of IResultHolder. The holder with the return value should not be on the queue when this method exits. The queue is scoped in the calling method so there is no need to synchronize access. More...
 
override bool WaitForResults (IRepeatInternalState state)
 see RepeatTemplate::WaitForResults More...
 
- Protected Member Functions inherited from Summer.Batch.Infrastructure.Repeat.Support.RepeatTemplate
IRepeatContext Start ()
 Delegates the start to the Completion policy. More...
 
bool CanContinue (RepeatStatus value)
 Check return value from batch operation. More...
 
void Update (IRepeatContext context)
 Delegates to the completion policy. More...
 
void ExecuteAfterInterceptors (IRepeatContext context, RepeatStatus value)
 Convenience method to execute after interceptors on a callback result. More...
 
bool IsComplete (IRepeatContext context, RepeatStatus result)
 Delegates to the Completion policy. More...
 
bool IsComplete (IRepeatContext context)
 Delegates to the Completion policy. More...
 

Properties

int ThrottleLimit [set]
 Public setter for the throttle limit. The throttle limit is the largest number of concurrent tasks that can be executing at one time - if a new task arrives and the throttle limit is breached we wait for one of the executing tasks to finish before submitting the new one to the IExecutor. Default value is DefaultThrottleLimit. N.B. when used with a thread pooled IExecutor the thread pool might prevent the throttle limit actually being reached (so make the core pool size larger than the throttle limit if possible). More...
 
ITaskExecutor TaskExecutor [set]
 Setter for task executor to be used to run the individual item callbacks. More...
 
- Properties inherited from Summer.Batch.Infrastructure.Repeat.Support.RepeatTemplate
ICompletionPolicy CompletionPolicy [set]
 Completion policy property. More...
 
IExceptionHandler ExceptionHandler [set]
 Exception handler property. More...
 

Additional Inherited Members

- Public Member Functions inherited from Summer.Batch.Infrastructure.Repeat.Support.RepeatTemplate
void SetListeners (IRepeatListener[] listeners)
 Registers array of listeners. More...
 
void RegisterListener (IRepeatListener listener)
 Registers given listener. More...
 
RepeatStatus Iterate (RepeatCallback callback)
 Execute the batch callback until the completion policy decides that we are finished. Wait for the whole batch to finish before returning even if the task executor is asynchronous. More...
 
- Static Protected Attributes inherited from Summer.Batch.Infrastructure.Repeat.Support.RepeatTemplate
static readonly Logger Logger = LogManager.GetCurrentClassLogger()
 Logger More...
 

Detailed Description

Support for RepeatOperations, including interceptors (used to modify or monitor the behavior at run time). Thread-safe class, provided that its collaborators are thread-safe as well.

Member Function Documentation

override IRepeatInternalState Summer.Batch.Infrastructure.Repeat.Support.TaskExecutorRepeatTemplate.CreateInternalState ( IRepeatContext  context)
protectedvirtual
override RepeatStatus Summer.Batch.Infrastructure.Repeat.Support.TaskExecutorRepeatTemplate.GetNextResult ( IRepeatContext  context,
RepeatCallback  callback,
IRepeatInternalState  state 
)
protectedvirtual

Use the TaskExecutor to generate a result. The internal state in this case is a queue of unfinished result holders of IResultHolder. The holder with the return value should not be on the queue when this method exits. The queue is scoped in the calling method so there is no need to synchronize access.

Parameters
context
callback
state
Returns

Reimplemented from Summer.Batch.Infrastructure.Repeat.Support.RepeatTemplate.

override bool Summer.Batch.Infrastructure.Repeat.Support.TaskExecutorRepeatTemplate.WaitForResults ( IRepeatInternalState  state)
protectedvirtual

Member Data Documentation

const int Summer.Batch.Infrastructure.Repeat.Support.TaskExecutorRepeatTemplate.DefaultThrottleLimit = 4

Default limit for maximum number of concurrent unfinished results allowed by the template.

Property Documentation

ITaskExecutor Summer.Batch.Infrastructure.Repeat.Support.TaskExecutorRepeatTemplate.TaskExecutor
set

Setter for task executor to be used to run the individual item callbacks.

int Summer.Batch.Infrastructure.Repeat.Support.TaskExecutorRepeatTemplate.ThrottleLimit
set

Public setter for the throttle limit. The throttle limit is the largest number of concurrent tasks that can be executing at one time - if a new task arrives and the throttle limit is breached we wait for one of the executing tasks to finish before submitting the new one to the IExecutor. Default value is DefaultThrottleLimit. N.B. when used with a thread pooled IExecutor the thread pool might prevent the throttle limit actually being reached (so make the core pool size larger than the throttle limit if possible).


The documentation for this class was generated from the following file:
  • Summer.Batch.Infrastructure/Repeat/Support/TaskExecutorRepeatTemplate.cs