{"action":"created","issue":{"url":"https://api.github.com/repos/reactor/reactor-core/issues/1935","repository_url":"https://api.github.com/repos/reactor/reactor-core","labels_url":"https://api.github.com/repos/reactor/reactor-core/issues/1935/labels{/name}","comments_url":"https://api.github.com/repos/reactor/reactor-core/issues/1935/comments","events_url":"https://api.github.com/repos/reactor/reactor-core/issues/1935/events","html_url":"https://github.com/reactor/reactor-core/issues/1935","id":515872558,"node_id":"MDU6SXNzdWU1MTU4NzI1NTg=","number":1935,"title":"Run parallel with Mono","user":{"login":"thanhngo219","id":16739666,"node_id":"MDQ6VXNlcjE2NzM5NjY2","avatar_url":"https://avatars0.githubusercontent.com/u/16739666?v=4","gravatar_id":"","url":"https://api.github.com/users/thanhngo219","html_url":"https://github.com/thanhngo219","followers_url":"https://api.github.com/users/thanhngo219/followers","following_url":"https://api.github.com/users/thanhngo219/following{/other_user}","gists_url":"https://api.github.com/users/thanhngo219/gists{/gist_id}","starred_url":"https://api.github.com/users/thanhngo219/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thanhngo219/subscriptions","organizations_url":"https://api.github.com/users/thanhngo219/orgs","repos_url":"https://api.github.com/users/thanhngo219/repos","events_url":"https://api.github.com/users/thanhngo219/events{/privacy}","received_events_url":"https://api.github.com/users/thanhngo219/received_events","type":"User","site_admin":false},"labels":[{"id":284719894,"node_id":"MDU6TGFiZWwyODQ3MTk4OTQ=","url":"https://api.github.com/repos/reactor/reactor-core/labels/for/stackoverflow","name":"for/stackoverflow","color":"c5def5","default":false},{"id":284719893,"node_id":"MDU6TGFiZWwyODQ3MTk4OTM=","url":"https://api.github.com/repos/reactor/reactor-core/labels/status/invalid","name":"status/invalid","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2019-11-01T02:26:35Z","updated_at":"2019-11-02T01:55:50Z","closed_at":null,"author_association":"NONE","body":"Hi. I am newbie in Reactor World. I am trying to use Mono and run details in parallel. But it seems that it runs in sequential. Do you have any suggestions to run this in parallel? My sample is that I have 3 method doA, doB, doC using 1 object but do 3 things differently. I intend to run this in parallel. It seems that I need to use ExecutorService to separate this.\r\n\r\n```\r\n    @Test\r\n    public void test() {\r\n        NewObject newObject = new NewObject();\r\n        newObject.setName(\"This is A\");\r\n        Mono.just(newObject)\r\n                .flatMap(newO -> {\r\n                    return doA(newO);\r\n                })\r\n                .flatMap(newO -> {\r\n                    return doB(newO);\r\n                })\r\n                .flatMap(newO -> {\r\n                    return doC(newO);\r\n                })\r\n                .subscribe();\r\n        ;\r\n    }\r\n\r\n    private Mono<NewObject> doA(NewObject newObject) {\r\n        return Mono.just(newObject)\r\n                .flatMap(newO -> {\r\n                    log.info(\"Do A\");\r\n                    try {\r\n                        Thread.sleep(500);\r\n                    } catch (InterruptedException e) {\r\n                        e.printStackTrace();\r\n                    }\r\n                    return Mono.just(newO);\r\n                })\r\n                ;\r\n    }\r\n\r\n    private Mono<NewObject> doB(NewObject newObject) {\r\n        return Mono.just(newObject)\r\n                .flatMap(newO -> {\r\n                    log.info(\"Do B\");\r\n                    try {\r\n                        Thread.sleep(500);\r\n                    } catch (InterruptedException e) {\r\n                        e.printStackTrace();\r\n                    }\r\n                    return Mono.just(newO);\r\n                })\r\n                ;\r\n    }\r\n\r\n    private Mono<NewObject> doC(NewObject newObject) {\r\n        return Mono.just(newObject)\r\n                .flatMap(newO -> {\r\n                    log.info(\"Do C\");\r\n                    try {\r\n                        Thread.sleep(500);\r\n                    } catch (InterruptedException e) {\r\n                        e.printStackTrace();\r\n                    }\r\n                    return Mono.just(newO);\r\n                })\r\n                ;\r\n    }\r\n\r\n    @Data\r\n    private class NewObject {\r\n        private String name;\r\n    }\r\n```\r\n\r\nResult:\r\n```\r\n21:24:12.735 [main] INFO com.Test - Do A\r\n21:24:13.238 [main] INFO com.Test - Do B\r\n21:24:13.740 [main] INFO com.Test - Do C\r\n```"},"comment":{"url":"https://api.github.com/repos/reactor/reactor-core/issues/comments/548999648","html_url":"https://github.com/reactor/reactor-core/issues/1935#issuecomment-548999648","issue_url":"https://api.github.com/repos/reactor/reactor-core/issues/1935","id":548999648,"node_id":"MDEyOklzc3VlQ29tbWVudDU0ODk5OTY0OA==","user":{"login":"thanhngo219","id":16739666,"node_id":"MDQ6VXNlcjE2NzM5NjY2","avatar_url":"https://avatars0.githubusercontent.com/u/16739666?v=4","gravatar_id":"","url":"https://api.github.com/users/thanhngo219","html_url":"https://github.com/thanhngo219","followers_url":"https://api.github.com/users/thanhngo219/followers","following_url":"https://api.github.com/users/thanhngo219/following{/other_user}","gists_url":"https://api.github.com/users/thanhngo219/gists{/gist_id}","starred_url":"https://api.github.com/users/thanhngo219/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thanhngo219/subscriptions","organizations_url":"https://api.github.com/users/thanhngo219/orgs","repos_url":"https://api.github.com/users/thanhngo219/repos","events_url":"https://api.github.com/users/thanhngo219/events{/privacy}","received_events_url":"https://api.github.com/users/thanhngo219/received_events","type":"User","site_admin":false},"created_at":"2019-11-02T01:55:50Z","updated_at":"2019-11-02T01:55:50Z","author_association":"NONE","body":"Hi @bsideup \r\nThank you. I will post on StackOverflow in the future.\r\nFYI, I figured out how to do this by using subscribeOn and Mono.when\r\nCan you close this for me?"}}
{"actor":{"display_login":"thanhngo219"}}