使用Gob在流处理中的示例

huangapple go评论236阅读模式
英文:

Example of using Gob in stream processing

问题

Gob在处理内部重复数据结构(如大型结构体切片或流式数据)时,在空间和性能效率方面表现良好,这一点已经有文档记录。然而,在搜索后,我没有找到直接的示例。

有人可以提供或链接一个如何在(可能是无限的)流式输入中使用Gob的示例吗?比如一个从队列中读取的工作器。

英文:

Gob is good in space and performance efficiency when processing internally repeating data structure like big slice of struct or streamed data as documented. However I can't find a direct example after some searching.

Can anyone give or link to an example of how to use in a (possibly infinite) streamed input? (like a worker reading from a queue)

答案1

得分: 1

处理流基本上就是处理io.Writer/io.Reader。我在Go Playground上分享了一段代码片段。希望对你有帮助。这是链接

英文:

Dealing with stream is basically dealing with io.Writer/io.Reader. I share a snippet on go playground. Hope that helps. http://play.golang.org/p/_pzLtX-zc2

huangapple
  • 本文由 发表于 2014年7月28日 09:50:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/24987492.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定