diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2021-07-14 22:59:28 +0200 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2021-07-14 22:59:28 +0200 |
commit | 902ae78beda424f203db8b8f59cd5e54516475af (patch) | |
tree | b16eb99cb7b05fda875598d47dde03fcd3f8e59a /skate/zipkey | |
parent | e99f54c2e653f0662ba0823fa3ac4bccc475dce1 (diff) | |
download | refcat-902ae78beda424f203db8b8f59cd5e54516475af.tar.gz refcat-902ae78beda424f203db8b8f59cd5e54516475af.zip |
update docs
Diffstat (limited to 'skate/zipkey')
-rw-r--r-- | skate/zipkey/batch.go | 7 |
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") |