Skip to content

Commit 43a3c39

Browse files
committed
more comment on NewBatchFuture
1 parent 8e50112 commit 43a3c39

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

x/batch.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@ type BatchFuture interface {
2828
GetFutures() []workflow.Future
2929
}
3030

31-
// NewBatchFuture creates a new batch future
31+
// NewBatchFuture creates a bounded-concurrency helper for doing bulk work in your workflow.
32+
// It does not reduce the amount of history your workflow stores, so any event-count
33+
// or history-size limits are unaffected - you must still be cautious about the total
34+
// amount of work you do in any workflow.
35+
//
36+
// When NewBatchFuture is called, futures created by the factories will be started sequentially until the concurrency limit (batchSize) is reached.
37+
// The remaining futures will be queued and started as previous futures complete, maintaining the specified concurrency level.
3238
func NewBatchFuture(ctx workflow.Context, batchSize int, factories []func(ctx workflow.Context) workflow.Future) (BatchFuture, error) {
3339
return batch.NewBatchFuture(ctx, batchSize, factories)
3440
}

0 commit comments

Comments
 (0)