Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncExecutor ¶
type AsyncExecutor struct {
// contains filtered or unexported fields
}
AsyncExecutor 异步执行器
func (*AsyncExecutor) SubmitAsync ¶
func (a *AsyncExecutor) SubmitAsync(job Job) *Future
SubmitAsync 提交异步任务
type ConcurrencyLimiter ¶
type ConcurrencyLimiter struct {
// contains filtered or unexported fields
}
ConcurrencyLimiter 并发限制器
func NewConcurrencyLimiter ¶
func NewConcurrencyLimiter(maxConcurrent int) *ConcurrencyLimiter
NewConcurrencyLimiter 创建并发限制器
func (*ConcurrencyLimiter) Execute ¶
func (cl *ConcurrencyLimiter) Execute(fn func() error) error
Execute 在并发限制下执行
func (*ConcurrencyLimiter) ExecuteBatch ¶
func (cl *ConcurrencyLimiter) ExecuteBatch(fns []func() error) []error
ExecuteBatch 批量执行
type ContextPool ¶
type ContextPool struct {
// contains filtered or unexported fields
}
ContextPool 上下文感知的 Worker 池
func (*ContextPool) StopWithContext ¶
func (p *ContextPool) StopWithContext(ctx context.Context) error
StopWithContext 带上下文停止
type ParallelExecutor ¶
type ParallelExecutor struct {
// contains filtered or unexported fields
}
ParallelParallel 并行执行器
func NewParallelExecutor ¶
func NewParallelExecutor(maxWorkers int) *ParallelExecutor
NewParallelExecutor 创建并行执行器
func (*ParallelExecutor) Execute ¶
func (p *ParallelExecutor) Execute(fns []func() error) []error
Execute 并行执行
type PooledExecutor ¶
type PooledExecutor struct {
// contains filtered or unexported fields
}
PooledExecutor 池化执行器
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
RateLimiter 速率限制器
type Semaphore ¶
type Semaphore struct {
// contains filtered or unexported fields
}
Semaphore 信号量
func (*Semaphore) WithSemaphore ¶
func (s *Semaphore) WithSemaphore(fn func())
WithSemaphore 在信号量控制下执行
type SimpleResult ¶
type SimpleResult struct {
// contains filtered or unexported fields
}
SimpleResult 简单结果
type WorkerPool ¶
type WorkerPool struct {
// contains filtered or unexported fields
}
WorkerPool Worker 池
func (*WorkerPool) SubmitBatch ¶
func (p *WorkerPool) SubmitBatch(jobs []Job) error
SubmitBatch 批量提交任务
Click to show internal directories.
Click to hide internal directories.