Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidWorkerCount = errors.New("worker count must be >0")
Functions ¶
func Work ¶
func Work[TRequest any, TResult any](ctx context.Context, requests chan TRequest, worker Worker[TRequest, TResult], options ...WorkOption) chan WorkResult[TResult]
Types ¶
type WorkOption ¶
type WorkOption func(*workConfig)
WorkOption is an option to modify the behavior of the Work function
func ResultChannelCapacity ¶
func ResultChannelCapacity(n int) WorkOption
ResultChannelCapacity defines the Work function's output channel capacity.
func WorkerCount ¶
func WorkerCount(n int) WorkOption
WorkerCount specifies the number of worker goroutines to create in the Work function.
type WorkResult ¶
Click to show internal directories.
Click to hide internal directories.