0

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)

Jason Xu
  • 2,903
  • 5
  • 31
  • 54

1 Answers1

1

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

Jarod
  • 1,662
  • 1
  • 11
  • 19
  • Thanks @Jarod for your code. Based on my use I modified the example to show sending, receiving multiple data object, which may represents working on a data flow. http://play.golang.org/p/j7gZEpteHH – Jason Xu Jul 28 '14 at 03:19