Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBatchInvalid = errors.New("轮数不能为0") ErrCapacityInvalid = errors.New("每轮循环数不能为0") )
Functions ¶
This section is empty.
Types ¶
type CoroutineGroup ¶
type CoroutineGroup[T any] struct { Error error OK bool Results []*Result[T] // contains filtered or unexported fields }
func New ¶
func New[T any]() *CoroutineGroup[T]
func (*CoroutineGroup[T]) Run ¶
func (my *CoroutineGroup[T]) Run(fn func(batch, capacity uint) (result *Result[T])) *CoroutineGroup[T]
func (*CoroutineGroup[T]) SetBatches ¶
func (my *CoroutineGroup[T]) SetBatches(batches uint) *CoroutineGroup[T]
func (*CoroutineGroup[T]) SetCapacity ¶
func (my *CoroutineGroup[T]) SetCapacity(capacity uint) *CoroutineGroup[T]
Click to show internal directories.
Click to hide internal directories.