SingleItemBatches
Creates n batches of items, where each batch contains a single item.
def SingleItemBatches(
context: context.Context,
snapshot: []ItemWrapper
) - > []Batch
Creates n batches of items, where n is the number of items in the input snapshot, and each batch contains exactly one item. This is useful for processing each item individually within a batch-oriented system.
Parameters
| Name | Type | Description |
|---|---|---|
| context | context.Context | The context for the operation, typically used for cancellation or deadlines. |
| snapshot | []ItemWrapper | A slice of ItemWrapper objects to be divided into single-item batches. |
Returns
| Type | Description |
|---|---|
[]Batch | A slice of batches, where each batch contains a single ItemWrapper. |