Discover Packages
github.com/fourplusone/go-batches
package
module
Version:
v0.0.0-...-973bf30
Opens a new window with list of versions in this module.
Published: Apr 16, 2019
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 1
Opens a new window with list of known importers.
README
README
¶
go-batches
Consolidates items into batches and processes them.
Documentation
Full docs are available on Godoc
Expand ▾
Collapse ▴
Documentation
¶
Package batches consolidates items into batches and processes them.
Usually, the creation of items is considered to be fast compared to the
final processing (like for example creating git commits vs. pushing them to
a repository.
type Combiner struct {
CombineFunc func(inputs []In ) Out
Input chan Item
}
Combiner consolidates tasks
Announce a new Item which will be processed on the next run of the combiner
Close stops processing any new Requests
DeliverSync delivers an Item and waits until it's been processed
Process must be called once and will start immideatly processing incoming
Items using the "CombineFunc".
In is the Input Type of an Item
type Item struct {
In chan In
Out chan Out
}
An Item to be processed
Out is the Output Type of the Combine Function
Source Files
¶
Click to show internal directories.
Click to hide internal directories.