You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
kratos/pkg/sync/pipeline/fanout
chenzhihui 9e060edc2d replace pkg name to go-kratos 5 years ago
..
CHANGELOG.md add metrics to databusutil and pipeline 5 years ago
README.md add pipeline (#74) 6 years ago
example_test.go add pipeline (#74) 6 years ago
fanout.go replace pkg name to go-kratos 5 years ago
fanout_test.go add pipeline (#74) 6 years ago
metrics.go replace pkg name to go-kratos 5 years ago

README.md

pkg/sync/pipeline/fanout

功能:

  • 支持定义Worker 数量的goroutine,进行消费
  • 内部支持的元数据传递(pkg/net/metadata)

示例:

//名称为cache 执行线程为1 buffer长度为1024
cache := fanout.New("cache", fanout.Worker(1), fanout.Buffer(1024))
cache.Do(c, func(c context.Context) { SomeFunc(c, args...) })
cache.Close()