We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FlatMap not run parallelly WithPool or WithCPUPool
See:
package main import ( "fmt" "time" "github.com/reactivex/rxgo/v2" ) func main() { obs := rxgo.Just(1, 2, 3)().FlatMap( func(i rxgo.Item) rxgo.Observable { time.Sleep(time.Second) return rxgo.Just(i.V.(int)*10, i.V.(int)*100)() }, rxgo.WithCPUPool(), ) start := time.Now().Unix() for item := range obs.Observe() { fmt.Printf("item: %+v\n", item) } end := time.Now().Unix() fmt.Printf("cost: %d seconds\n", end-start) }
Expect: cost 1 seconds
Actual: cost 3 seconds
The text was updated successfully, but these errors were encountered:
#279 Is this fix ready? This works as expected in the other implementations of reactivex I tried(RxJS, RxJava/Reactor).
rxgo.Just(urls)().FlatMap(func(i rxgo.Item) rxgo.Observable { return doRequest(i.V.(string)) }, rxgo.WithPool(32)).ForEach(out, func(e error) {}, func() {})
rxgo.Just(urls)().Map(func(c context.Context, i interface{}) (interface{}, error) { val, err := <-doRequest(i.(string)).Observe() return val, err }, rxgo.WithPool(32)).ForEach(out, func(e error) {}, func() {})
These two should do the same thing
Sorry, something went wrong.
#279 Is this fix ready? This works as expected in the other implementations of reactivex I tried(RxJS, RxJava/Reactor). rxgo.Just(urls)().FlatMap(func(i rxgo.Item) rxgo.Observable { return doRequest(i.V.(string)) }, rxgo.WithPool(32)).ForEach(out, func(e error) {}, func() {}) rxgo.Just(urls)().Map(func(c context.Context, i interface{}) (interface{}, error) { val, err := <-doRequest(i.(string)).Observe() return val, err }, rxgo.WithPool(32)).ForEach(out, func(e error) {}, func() {}) These two should do the same thing
These codes are not merged, the issue still exists
teivah
No branches or pull requests
FlatMap not run parallelly WithPool or WithCPUPool
See:
Expect:
cost 1 seconds
Actual:
cost 3 seconds
The text was updated successfully, but these errors were encountered: