Hi Alex McCarrier. First of all, I’ll have to admit that I’ve lost some steam on working on RxGo. Last few months has been my sabbatical from Go and I went out trying functional languages like Ocaml and Lisp in the hope of getting more from programming.
With that said, this new year I plan on a major overhaul of RxGo. It started out as an experimental project, but then it got backed by reactivex and the supports skyrocketed. I guess you all deserve a better RxGo.
One obvious weakness of RxGo currently is in its use of structs as primitives like Observable
, Connectable
, etc. This makes it inextensible. Plan is to shift most (if not all) to interface types.
Second but major pain point that got a lot of users confused is the stream is based on Go channels. This makes the data source concurrent (good) but unpredictable when several subscribers/observers are consuming it.
To answer your question with another question, have you tried doing this?
observable.Start(func() interface{} {
return valueCreatingWorkThing()
}).Subscribe(handers.NextFunc(func(item interface{}) {
fmt.Print("got next %v", item)
})
Subscribe
method takes whatever implements rx.EventHandler
interface which means it can be a function or an observer.Observer
object.