tangs b030ce89ca openbilibili | 5 anni fa | |
---|---|---|
.. | ||
BUILD | 5 anni fa | |
CHANGELOG.md | 5 anni fa | |
CONTRIBUTORS.md | 5 anni fa | |
OWNERS | 5 anni fa | |
README.md | 5 anni fa | |
example_test.go | 5 anni fa | |
fanout.go | 5 anni fa | |
fanout_test.go | 5 anni fa |
以前的library/cache包改为pipeline/fanout
增加使用范围 不止由于异步增加缓存 也可以用在其他地方
功能:
示例:
//名称为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()