Interface for batch completion policies, to enable batch operations to strategise normal completion conditions. Stateful implementations of batch iterators should only update state using the update method. If you need custom behaviour consider extending an existing implementation or using the composite provided. More...
Public Member Functions | |
bool | IsComplete (IRepeatContext context, RepeatStatus result) |
Determine whether a batch is complete given the latest result from the callback. If this method returns true then IsComplete(IRepeatContext) should also (but not necessarily vice versa, since the answer here depends on the result). More... | |
bool | IsComplete (IRepeatContext context) |
Allow policy to signal completion according to internal state, without having to wait for the callback to complete. More... | |
IRepeatContext | Start (IRepeatContext parent) |
Create a new context for the execution of a batch. N.B. implementations should not return the parent from this method - they must create a new context to meet the specific needs of the policy. The best way to do this might be to override an existing implementation and use the RepeatContext to store state in its attributes. More... | |
void | Update (IRepeatContext context) |
Give implementations the opportunity to update the state of the current batch. Will be called once per callback, after it has been launched, but not necessarily after it completes (if the batch is asynchronous). More... | |
Detailed Description
Interface for batch completion policies, to enable batch operations to strategise normal completion conditions. Stateful implementations of batch iterators should only update state using the update method. If you need custom behaviour consider extending an existing implementation or using the composite provided.
Member Function Documentation
bool Summer.Batch.Infrastructure.Repeat.ICompletionPolicy.IsComplete | ( | IRepeatContext | context, |
RepeatStatus | result | ||
) |
Determine whether a batch is complete given the latest result from the callback. If this method returns true then IsComplete(IRepeatContext) should also (but not necessarily vice versa, since the answer here depends on the result).
- Parameters
-
context the current batch context. result the result of the latest batch item processing.
- Returns
- true if the batch should terminate.
Implemented in Summer.Batch.Infrastructure.Repeat.Policy.SimpleCompletionPolicy, Summer.Batch.Infrastructure.Repeat.Policy.CompletionPolicySupport, and Summer.Batch.Infrastructure.Repeat.Policy.DefaultResultCompletionPolicy.
bool Summer.Batch.Infrastructure.Repeat.ICompletionPolicy.IsComplete | ( | IRepeatContext | context | ) |
Allow policy to signal completion according to internal state, without having to wait for the callback to complete.
- Parameters
-
context
- Returns
- true if the batch should terminate.
Implemented in Summer.Batch.Infrastructure.Repeat.Policy.SimpleCompletionPolicy, Summer.Batch.Infrastructure.Repeat.Policy.CompletionPolicySupport, and Summer.Batch.Infrastructure.Repeat.Policy.DefaultResultCompletionPolicy.
IRepeatContext Summer.Batch.Infrastructure.Repeat.ICompletionPolicy.Start | ( | IRepeatContext | parent | ) |
Create a new context for the execution of a batch. N.B. implementations should not return the parent from this method - they must create a new context to meet the specific needs of the policy. The best way to do this might be to override an existing implementation and use the RepeatContext to store state in its attributes.
- Parameters
-
parent the current context if one is already in progress.
- Returns
- a context object that can be used by the implementation to store internal state for a batch.
Implemented in Summer.Batch.Infrastructure.Repeat.Policy.SimpleCompletionPolicy, and Summer.Batch.Infrastructure.Repeat.Policy.CompletionPolicySupport.
void Summer.Batch.Infrastructure.Repeat.ICompletionPolicy.Update | ( | IRepeatContext | context | ) |
Give implementations the opportunity to update the state of the current batch. Will be called once per callback, after it has been launched, but not necessarily after it completes (if the batch is asynchronous).
- Parameters
-
context the value returned by start
Implemented in Summer.Batch.Infrastructure.Repeat.Policy.CompletionPolicySupport.
The documentation for this interface was generated from the following file:
- Summer.Batch.Infrastructure/Repeat/ICompletionPolicy.cs