-
Notifications
You must be signed in to change notification settings - Fork 14
[Feature]: branch/iteration namer for concurrent operations #303
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
What would you like?
Name an iteration of map:
const results = await context.map(
"process-items",
items,
async (ctx, item, index) => {
return await ctx.step(`process-${index}`, async () => process(item));
},
{
maxConcurrency: 5,
itemNamer: (item, index) => `item-${item.id}`, // Custom iteration names
},
);
Name a branch of parallel:
const results = await context.parallel(
"parallel-ops",
[
{
name: "fetch-user-data", // Custom name for this branch
func: async (ctx) => ctx.step(async () => fetchData1())
},
{
name: "fetch-order-history", // Custom name for this branch
func: async (ctx) => ctx.step(async () => fetchData2())
},
],
{ maxConcurrency: 2 },
);
export interface NamedParallelBranch<TResult, Logger extends DurableLogger> {
name?: string;
func: ParallelFunc<TResult, Logger>;
}
Possible Implementation
No response
Is this a breaking change?
No
Does this require an RFC?
No
Additional Context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
Backlog