pub async fn map_handler<T, U, F, Fut>(
items: Vec<T>,
func: F,
state: &Arc<ExecutionState>,
op_id: &OperationIdentifier,
parent_ctx: &DurableContext,
config: &MapConfig,
logger: &Arc<dyn Logger>,
) -> Result<BatchResult<U>, DurableError>where
T: Serialize + DeserializeOwned + Send + Sync + Clone + 'static,
U: Serialize + DeserializeOwned + Send + 'static,
F: Fn(DurableContext, T, usize) -> Fut + Send + Sync + Clone + 'static,
Fut: Future<Output = Result<U, DurableError>> + Send + 'static,Expand description
Executes a map operation over a collection with parallel processing.
This handler implements the map semantics:
- Creates a child context for each item
- Uses ConcurrentExecutor for parallel execution
- Supports ItemBatcher for batching
- Returns BatchResult with results for all items
§Arguments
items- The collection of items to processfunc- The function to apply to each itemstate- The execution state for checkpointingop_id- The operation identifier for the map operationparent_ctx- The parent DurableContextconfig- Map configurationlogger- Logger for structured logging
§Returns
A BatchResult containing results for all items.