make simple ReactiveX pattern for golang
- 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) })