89
}
90
92
>
if q.lastTask == nil || sequentialBatchableTaskQueueCompareLess(q.lastTask, task) {
93
>
q.lastTask = task
94
>
}
95
}
96
97
>
func (q *SequentialBatchableTaskQueue) createBatchedTask(task TrackableExecutableTask) *batchedTask {
sequential_batch_queue.go
98
>
return &batchedTask{
99
>
batchedTask: task,
100
>
individualTasks: []TrackableExecutableTask{task},
101
>
state: batchStateOpen,
102
>
103
>
// This is to add individual task back to this queue, so it can be processed again. This is based on an assumption: only one thread is
104
>
// interacting with the queue. And this is a shortcut because a proper way is to resubmit the individual tasks back to scheduler.
105
>
// But that requires a refactor on scheduler and task lifecycle and could be risky to included in this feature implementation.
106
>
//
107
>
individualTaskHandler: func(task TrackableExecutableTask) {
108
q.Add(task)
109
},