gobatch

package module
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 4 Imported by: 2

README

gobatch

Go batch job

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batcher

type Batcher struct {
	BatchSize uint
	MaxWait   time.Duration
	Job       Job
	MaxRetry  uint

	Logger *zap.Logger
	// contains filtered or unexported fields
}

Batcher struct for batcher job.

func NewBatcher

func NewBatcher(job Job) *Batcher

func (*Batcher) Start

func (b *Batcher) Start(ctx context.Context) (chan interface{}, error)

Start start batch

type Job

type Job func(ctx context.Context, queue []interface{}) error

type Logger added in v0.1.0

type Logger interface {
	Debug(msg string, keyAndValue ...interface{})
	// Info logs routine messages about cron's operation.
	Info(msg string, keysAndValues ...interface{})
	// Error logs an error condition.
	Error(err error, msg string, keysAndValues ...interface{})
}

type LoggerImpl added in v0.1.0

type LoggerImpl struct {
}

func (*LoggerImpl) Debug added in v0.1.0

func (l *LoggerImpl) Debug(msg string, keyAndValue ...interface{})

Jump to

Keyboard shortcuts

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