You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A tasklet is not necessarily chunk-oriented, so having a ChunkContext as a parameter in Tasklet#execute feels strange (if not wrong) to me:
@FunctionalInterfacepublicinterfaceTasklet {
/** * Given the current context in the form of a step contribution, do whatever is * necessary to process this unit inside a transaction. Implementations return * {@link RepeatStatus#FINISHED} if finished. If not they return * {@link RepeatStatus#CONTINUABLE}. On failure throws an exception. * @param contribution mutable state to be passed back to update the current step * execution * @param chunkContext attributes shared between invocations but not between restarts * @return an {@link RepeatStatus} indicating whether processing is continuable. * Returning {@code null} is interpreted as {@link RepeatStatus#FINISHED} * @throws Exception thrown if error occurs during execution. */@NullableRepeatStatusexecute(StepContributioncontribution, ChunkContextchunkContext) throwsException;
}
The chunk context is documented to hold attributes shared between invocations but not between restarts, but is this really required? This actually violates the ISP for people not using this functionality (ie the parameter won't be used).
If considered, this would be a big breaking change, but it is worth fixing in a major release for a cleaner API design.
The text was updated successfully, but these errors were encountered:
A tasklet is not necessarily chunk-oriented, so having a
ChunkContext
as a parameter inTasklet#execute
feels strange (if not wrong) to me:The chunk context is documented to hold attributes shared between invocations but not between restarts, but is this really required? This actually violates the ISP for people not using this functionality (ie the parameter won't be used).
If considered, this would be a big breaking change, but it is worth fixing in a major release for a cleaner API design.
The text was updated successfully, but these errors were encountered: