aboutsummaryrefslogtreecommitdiffstats
path: root/skate/zipkey/batch.go
diff options
context:
space:
mode:
Diffstat (limited to 'skate/zipkey/batch.go')
-rw-r--r--skate/zipkey/batch.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/skate/zipkey/batch.go b/skate/zipkey/batch.go
index 6ab7eee..56f6f0d 100644
--- a/skate/zipkey/batch.go
+++ b/skate/zipkey/batch.go
@@ -22,7 +22,7 @@ type Batcher struct {
closing bool // https://stackoverflow.com/q/16105325/89391
}
-// NewBatcher set ups a new Batcher with a batch size of 1000.
+// NewBatcher set ups a new Batcher with a default batch size.
func NewBatcher(gf groupFunc) *Batcher {
return NewBatcherSize(gf, defaultBatchSize)
}
@@ -43,7 +43,8 @@ func NewBatcherSize(gf groupFunc, size int) *Batcher {
}
// Close tears down the batcher. If this is not called, you get goroutine leaks
-// and will miss the data from the last uncommitted batch.
+// and will miss the data from the last uncommitted batch. Calling this
+// function more than once will result in a panic.
func (b *Batcher) Close() error {
b.closing = true
g := make([]*Group, len(b.batch))
@@ -56,7 +57,7 @@ func (b *Batcher) Close() error {
}
// GroupFunc is a drop-in for a groupFunc. Use this function, where you used
-// grouper before. Not thread safe. Panics if called after Close.
+// groupFunc before. Not thread safe. Panics if called after Close.
func (b *Batcher) GroupFunc(g *Group) error {
if b.closing {
panic("cannot call GroupFunc after Close")