pool

package
v2.23.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: MIT Imports: 3 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

type Pool interface {
	// GetConfig returns pool configuration.
	GetConfig() any

	// Exec executes task with payload
	Exec(rqs *payload.Payload) (*payload.Payload, error)

	// ExecWithTTL executes task with context which is used with timeout
	ExecWithTTL(ctx context.Context, rqs *payload.Payload) (*payload.Payload, error)

	// Workers returns worker list associated with the pool.
	Workers() (workers []worker.BaseProcess)

	// RemoveWorker removes worker from the pool.
	RemoveWorker(worker worker.BaseProcess) error

	// Reset kill all workers inside the watcher and replaces with new
	Reset(ctx context.Context) error

	// Destroy all underlying stack (but let them to complete the task).
	Destroy(ctx context.Context)
}

Pool managed set of inner worker processes.

type Queuer added in v2.10.0

type Queuer interface {
	// QueueSize can be implemented on the pool to provide the requests queue information
	QueueSize() uint64
}

type Streamer added in v2.13.0

type Streamer interface {
	// ExecStream executes task with payload
	ExecStream(rqs *payload.Payload, resp chan *payload.Payload, stopCh chan struct{}) error

	// ExecStreamWithTTL executes task with context which is used with timeout
	ExecStreamWithTTL(ctx context.Context, rqs *payload.Payload, resp chan *payload.Payload, stopCh chan struct{}) error
}

Streamer managed set of inner worker processes. [BETA] interface, might be changed later

type Supervised

type Supervised interface {
	Pool
	// Start used to start watching process for all pool workers
	Start()
}

Jump to

Keyboard shortcuts

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