Skip to content

findcoo/stream

Repository files navigation

stream

Go Travis Ci Go Report Card

make simple ReactiveX pattern for golang

Subsets

Example

  • bytes stream
      obv := NewObserver(nil)
      stream := NewBytesStream(obv)
      stream.Target = func() {
      	for i := 0; i <= 10; i++ {
      		stream.Send([]byte{byte(i)})
      	}
      	stream.OnComplete()
      }
    
      stream.Publish(nil).Subscribe(func(data []byte) {
      	log.Print(data)
      })