gpool

package module
v0.0.0-...-32eaf10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

README

gpool

Goroutine Pool 携程池,对于并发的执行一些不关心任务结果的任务有较好的效果。

Documentation

Overview

Package gpool Date: 2023/12/6 10:53 Author: Amu Description:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoroutinePool

type GoroutinePool struct {
	// contains filtered or unexported fields
}

func NewGPool

func NewGPool(workerSize, taskSize int) *GoroutinePool

func (*GoroutinePool) Start

func (gp *GoroutinePool) Start() *GoroutinePool

func (*GoroutinePool) Stop

func (gp *GoroutinePool) Stop()

func (*GoroutinePool) Submit

func (gp *GoroutinePool) Submit(f TaskFunc, args ...interface{}) error

type Task

type Task struct {
	// contains filtered or unexported fields
}

func (*Task) Execute

func (t *Task) Execute()

type TaskFunc

type TaskFunc func(args ...interface{})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL