base

package
v2.0.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2019 License: BSD-2-Clause Imports: 3 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.Consumer, 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) Add

func (f *Factory) Add(q taskq.Queuer)

func (*Factory) Close

func (f *Factory) Close() error

func (*Factory) Queues

func (f *Factory) Queues() []taskq.Queuer

func (*Factory) StartConsumers

func (f *Factory) StartConsumers() error

func (*Factory) StopConsumers

func (f *Factory) StopConsumers() error

Jump to

Keyboard shortcuts

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