pool

package
v0.1.928 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	contract.PoolOperator
}

func NewClient

func NewClient(opts ClientOptions) Client

type ClientOption added in v0.1.6

type ClientOption = contract.Opt[ClientOptions]

func WithConcurrency

func WithConcurrency(x int) ClientOption

type ClientOptions added in v0.1.6

type ClientOptions struct {
	Concurrency int
}

func ApplyClientOptions added in v0.1.6

func ApplyClientOptions(opts *ClientOptions, modifiers ...ClientOption) ClientOptions

type DefaultTool added in v0.1.11

type DefaultTool struct {
	T *contract.Tool[Client]
}

func NewTool

func NewTool(c Client, opts contract.ToolOptions[Client]) *DefaultTool

func (*DefaultTool) Acquire added in v0.1.11

func (d *DefaultTool) Acquire(ctx context.Context) error

Acquire reserves a worker slot in the pool.

func (*DefaultTool) ActiveWorkers added in v0.1.11

func (d *DefaultTool) ActiveWorkers(ctx context.Context) (int, error)

ActiveWorkers returns the number of currently active workers.

func (*DefaultTool) CloneWithConcurrency added in v0.1.558

func (d *DefaultTool) CloneWithConcurrency(ctx context.Context, x int) (contract.PoolOperator, error)

CloneWithConcurrency creates a new clone with the specified concurrency level.

func (*DefaultTool) Release added in v0.1.11

func (d *DefaultTool) Release(ctx context.Context) error

Release frees a worker slot in the pool.

func (*DefaultTool) Shutdown added in v0.1.11

func (d *DefaultTool) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the worker pool, preventing new workers from being added.

func (*DefaultTool) WaitAll added in v0.1.11

func (d *DefaultTool) WaitAll(ctx context.Context) error

WaitAll blocks until all workers have completed their tasks.

type Tool added in v0.1.245

type Tool interface {
	Client
}

Jump to

Keyboard shortcuts

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