batch

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewListener

func NewListener(batch Batch, batchSize int) listener.ItemListener

NewListener is an item listener to persist data

Types

type Batch

type Batch interface {
	OnItems(items []interface{}) error
}

Batch represents a bulk of items to persist

type ItemListener

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

ItemListener listens to a given item

func (*ItemListener) Close

func (listener *ItemListener) Close() error

Close closes the itemListener to remove any resources

func (*ItemListener) Commit

func (listener *ItemListener) Commit() error

func (*ItemListener) OnItem

func (listener *ItemListener) OnItem(item interface{}) error

OnItem listens to a given item

Jump to

Keyboard shortcuts

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