base

package
v3.0.0-...-95fe89c Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batcher

type Batcher struct {
	// contains filtered or unexported fields
}

Batcher collects messages for later batch processing.

func NewBatcher

func NewBatcher(consumer taskq.QueueConsumer, opt *BatcherOptions) *Batcher

func (*Batcher) Add

func (b *Batcher) Add(msg *taskq.Message) error

func (*Batcher) Close

func (b *Batcher) Close() error

type BatcherOptions

type BatcherOptions struct {
	Handler     func([]*taskq.Message) error
	ShouldBatch func([]*taskq.Message, *taskq.Message) bool

	Timeout time.Duration
}

type Factory

type Factory struct {
	// contains filtered or unexported fields
}

func (*Factory) Close

func (f *Factory) Close() error

func (*Factory) Range

func (f *Factory) Range(fn func(queue taskq.Queue) bool)

func (*Factory) Register

func (f *Factory) Register(queue taskq.Queue) error

func (*Factory) Reset

func (f *Factory) Reset()

func (*Factory) StartConsumers

func (f *Factory) StartConsumers(ctx context.Context) error

func (*Factory) StopConsumers

func (f *Factory) StopConsumers() error

func (*Factory) Unregister

func (f *Factory) Unregister(name string)

Jump to

Keyboard shortcuts

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