Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoroutinePool ¶
type GoroutinePool[T, R any] interface { Start() Stop() Do(T, ResponseFn[T, R]) }
GoroutinePool[T, R] goroutine pool interface
func NewGoroutinePool ¶
func NewGoroutinePool[T, R any](fn DoFn[T, R], opts ...Option) GoroutinePool[T, R]
NewGoroutinePool[T, R] create a new GoroutinePool[T, R] instance
type GoroutinePool2 ¶ added in v0.5.0
GoroutinePool2[T] goroutine pool interface
func NewGoroutinePool2 ¶ added in v0.5.0
func NewGoroutinePool2[T any](fn RunFn[T], opts ...Option) GoroutinePool2[T]
NewGoroutinePool2[T] create a new GoroutinePool2[T] instance
type GoroutinePool3 ¶ added in v0.18.0
type GoroutinePool3[T any] interface { Start() Stop() Exec(T) }
GoroutinePool3[T] goroutine pool interface
func NewGoroutinePool3 ¶ added in v0.18.0
func NewGoroutinePool3[T any](fn ExecFn[T], opts ...Option) GoroutinePool3[T]
NewGoroutinePool3[T] create a new GoroutinePool3[T] instance
type Option ¶ added in v0.6.0
type Option = func(opt *gorotinePoolOpt)
Option groutine pool option help function used to create groutine pool instance
func WithMaxIdelTime ¶ added in v0.10.0
WithMaxIdelTime set max idle time to custom a worker max wait tile to worker
func WithMaxRequestBuf ¶ added in v0.10.0
WithMaxRequestBuf set max request buffer size
func WithMaxRequestTempBuf ¶ added in v0.10.0
WithMaxRequestTempBuf set max request temp buffer size
func WithMaxTempWorker ¶ added in v0.10.0
WithMaxRequestBuf set max temp worker count
func WithMinWorker ¶ added in v0.10.0
WithMinWorker set min worker count
func WithWorkerHook ¶ added in v0.10.0
func WithWorkerHook(h WorkerHook) Option
WithWorkerHookOpt set wroker hook
type ResponseFn ¶
ResponseFn[T, R] response handle function
type WorkPool ¶ added in v0.10.1
WorkPool work pool interface
func NewBufferWorkPool ¶ added in v0.10.1
NewBufferWorkPool create a work pool instance use buffer style
func NewSimpleWorkPool ¶ added in v0.10.1
NewSimpleWorkPool create a work pool instance use simple style
type WorkerHook ¶ added in v0.9.1
WorkerHook hook worker status