Skip to content

Commit

Permalink
Simplify readme example
Browse files Browse the repository at this point in the history
  • Loading branch information
gzuidhof committed Nov 20, 2024
1 parent 3d137cd commit d3f472a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ func Flush(ctx context.Context, items []MyItemType) {

You then use the builder pattern with `batchman.New[MyItemType]()` and configure it with `MaxSize`, `MaxDelay` and `BufferSize`.

After that you can start it and push items to it.

```go
init := batchman.New[MyItemType]().MaxSize(2_000).MaxDelay(10 * time.Second)
```

Finally, you start the batcher with `Start` and push items to it with `Push`.

```go
batcher, err := init.Start(ctx, Flush)
if err != nil {
panic(err)
Expand Down

0 comments on commit d3f472a

Please sign in to comment.