From 902ae78beda424f203db8b8f59cd5e54516475af Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Wed, 14 Jul 2021 22:59:28 +0200 Subject: update docs --- skate/zipkey/batch.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'skate/zipkey') 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") -- cgit v1.2.3