Documentation
¶
Overview ¶
* @Author: cnzf1 * @Date: 2021-12-15 14:18:20 * @LastEditors: cnzf1 * @LastEditTime: 2022-12-02 22:07:45 * @Description:
* @Author: cnzf1 * @Date: 2021-12-15 14:18:20 * @LastEditors: cnzf1 * @LastEditTime: 2022-08-27 16:06:04 * @Description:
* @Author: cnzf1 * @Date: 2021-12-15 14:18:20 * @LastEditors: cnzf1 * @LastEditTime: 2022-12-02 23:23:22 * @Description:
* @Author: cnzf1 * @Date: 2021-12-15 14:18:20 * @LastEditors: cnzf1 * @LastEditTime: 2022-08-30 11:34:24 * @Description:
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RoutineGroup ¶
type RoutineGroup struct {
// contains filtered or unexported fields
}
func NewRoutineGroup ¶
func NewRoutineGroup() *RoutineGroup
func (*RoutineGroup) Run ¶
func (g *RoutineGroup) Run(fn func())
func (*RoutineGroup) RunSafe ¶
func (g *RoutineGroup) RunSafe(fn func())
func (*RoutineGroup) Wait ¶
func (g *RoutineGroup) Wait()
type TaskRunner ¶ added in v1.2.2
type TaskRunner struct {
// contains filtered or unexported fields
}
A TaskRunner is used to control the concurrency of goroutines.
func NewTaskRunner ¶ added in v1.2.2
func NewTaskRunner(concurrency int) *TaskRunner
NewTaskRunner returns a TaskRunner.
func (*TaskRunner) Schedule ¶ added in v1.2.2
func (rp *TaskRunner) Schedule(task func())
Schedule schedules a task to run under concurrency control.
type WorkerGroup ¶
type WorkerGroup struct {
// contains filtered or unexported fields
}
func NewWorkerGroup ¶
func NewWorkerGroup(job func(), workers int) WorkerGroup
func (WorkerGroup) Start ¶
func (wg WorkerGroup) Start()
Click to show internal directories.
Click to hide internal directories.