<p>I am looking for articles about chaining channels. I have done my own version based on the worker pattern, but I haven't found any information about chaining these workers into a processing chain that I can compare my impl to. </p>
<p>My pattern:</p>
<p>Producer gathers data and feeds to a producer channel. </p>
<p>Consumer reads producer channel and performs logic. This can be run in multiple go routines for faster processing. Original data is fed to a new Producer channel so that another consumer can process the original data. </p>
<p>This pattern can be applied over and over:</p>
<p>Producer -> Consumer / Producer -> Consumer / Producer ...</p>
<hr/>**评论:**<br/><br/>joshuaboelter: <pre><p>I built something like what you're describing a few years ago and use it for a variety of pipelines. It has some areas around logging and buffering that could be improved, but it works great.</p>
<p><a href="https://godoc.org/github.com/jboelter/pipeline" rel="nofollow">https://godoc.org/github.com/jboelter/pipeline</a>
<a href="https://github.com/jboelter/pipeline" rel="nofollow">https://github.com/jboelter/pipeline</a></p></pre>integrii: <pre><p>Are you looking for articles because you have a more specific problem that you didn't mention here?</p>
<p>It seems like you have this figured out already You make a bunch of channels and as work is completed, its dropped into the next stage's channel. </p></pre>Seventh_Heaven: <pre><p>I don't have a problem. It's works, though I am wondering if there is better/go-to pattern. Or maybe something that is written better. I feel like my version has room for improvement...</p></pre>Frakturfreund: <pre><p>You have probably already read the entry on the go blog, but just in case: <a href="https://blog.golang.org/pipelines" rel="nofollow">Go Concurrency Patterns: Pipelines and cancellation</a></p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传