Skip to content

yyh1102/go-batcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-batcher

Simply create batch handler in go

Install

go get github.com/yyh1102/go-batcher

Usage

Batch

batch:=NewBatch("TEST", 10, 5*time.Second, func(batch []interface{}) {
    // Do your task with batch
})
// Push single data into batch
batch.Push(1)

// Push batch of data into batch
arr:=[]interface{}{1,2,3}
batch.Batch(arr)

Batcher (manage batches)

......
batcher:=NewBatcher()
batcher.AddBatch(batch)
batcher.GetBatch("TEST")    // "Batch { name:"TEST", maxCapacity: 10, timeout:5s }"

About

Simply create and use batch handler in go

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages