routine

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FactoryStreamPool

type FactoryStreamPool[T any] struct {
	// contains filtered or unexported fields
}

func AsyncStreamPool

func AsyncStreamPool[T any](workerCount, bufferSize int) *FactoryStreamPool[T]

func SyncStreamPool

func SyncStreamPool[T any](bufferSize int) *FactoryStreamPool[T]

func (*FactoryStreamPool[T]) DisableAutoDrain

func (f *FactoryStreamPool[T]) DisableAutoDrain() *FactoryStreamPool[T]

func (*FactoryStreamPool[T]) EnableAutoDrain

func (f *FactoryStreamPool[T]) EnableAutoDrain() *FactoryStreamPool[T]

func (*FactoryStreamPool[T]) ForceExit

func (f *FactoryStreamPool[T]) ForceExit() *FactoryStreamPool[T]

func (*FactoryStreamPool[T]) GraceExit

func (f *FactoryStreamPool[T]) GraceExit() *FactoryStreamPool[T]

func (*FactoryStreamPool[T]) Make

func (f *FactoryStreamPool[T]) Make() *StreamPool[T]

type Job

type Job[T any] func(ctx context.Context) (T, error)

type JobError

type JobError[T any] struct {
	Instance string
	Thread   int
	Error    error
}

type JobResult

type JobResult[T any] struct {
	Instance string
	Thread   int
	Output   T
}

type StreamPool

type StreamPool[T any] struct {
	// contains filtered or unexported fields
}

func (*StreamPool[T]) Done

func (p *StreamPool[T]) Done() <-chan struct{}

func (*StreamPool[T]) Errors

func (p *StreamPool[T]) Errors() <-chan JobError[T]

func (*StreamPool[T]) Id

func (p *StreamPool[T]) Id(job Job[T]) string

func (*StreamPool[T]) Results

func (p *StreamPool[T]) Results() <-chan JobResult[T]

func (*StreamPool[T]) Stop

func (p *StreamPool[T]) Stop() *StreamPool[T]

func (*StreamPool[T]) Submit

func (p *StreamPool[T]) Submit(job Job[T]) bool

Jump to

Keyboard shortcuts

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