my question ruby rx library, although example in language gladly appreciated. want schedule every operation existing event loop (or thread pool, matter). guess has done scheduler. haven't found example of scheduler sending recursive operations event loop, , why i'm asking. here's list ruby rx:
https://github.com/reactivex/rxruby/tree/master/lib/rx/concurrency
why event loop? because want add io operations work inside event loop , leverage concurrency. this:
rx::observable.from_enumerable(hosts). map { |h| http.connect(h) }. map{|host| host.get("http://myservice/somelist.txt") }. on_next { |html| parse(html).each_line.....} # idea
this done scheduler, , expect rubyrx port has included eventloopscheduler
.
you can either enqueue/scheduler them onto observeon
operator
rx::observable.from_enumerable(hosts). observeon(els). # have declared els somewhere else eventloopscheduler instance map { |h| http.connect(h) }. map{|host| host.get("http://myservice/somelist.txt") }. on_next { |html| parse(html).each_line.....} # idea
or add concurrency in map
rx::observable.from_enumerable(hosts). observeon(els). # have declared els somewhere else eventloopscheduler instance map { |h| http.connect(h) }. flatmap{|host| rx::observable.start(host.get("http://myservice/somelist.txt"), els) }. on_next { |html| parse(html).each_line.....} # idea
i hope code work (i c#/js)
Comments
Post a Comment