-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdoc.go
More file actions
34 lines (34 loc) · 970 Bytes
/
Copy pathdoc.go
File metadata and controls
34 lines (34 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Package gobatch is the root of the GoBatch library.
//
// It consists of three subpackages:
//
// - batch: The core batching engine for building processing pipelines.
// - processor: Several Processor implementations for common operations.
// - source: Source implementations for ingesting data from various origins.
//
// Basic usage ties these packages together:
//
// cfg := batch.NewConstantConfig(&batch.ConfigValues{MinItems: 1})
// b := batch.New[string](cfg)
// ch := make(chan string, 1)
// ch <- "hello"
// close(ch)
// src := &source.Channel[string]{Input: ch}
// proc := &processor.Transform[string]{Func: func(v string) (string, error) {
// fmt.Println(v)
// return v, nil
// }}
//
// errs, err := b.Go(context.Background(), src, proc)
// if err != nil {
// log.Fatal(err)
// }
// batch.IgnoreErrors(errs)
// <-b.Done()
//
// Output:
//
// hello
//
// See the README.md for an overview of how these pieces fit together.
package gobatch