on 2018 May 29 2:27 PM
Hi, anyone having idea of implementation of multithreading (asynchronous calls) for populators in hybris.
Request clarification before answering.
Hi,
You will need to override the DefaultConverter and use parallelStream instead of stream.
But you have to be really cautious with that and make sure the order of your populator call can be in any order (that means a populator should not depend on the result of another) etc
and replace
getPopulators() //
.stream() //
.filter(Objects::nonNull) //
.forEach(populator -> populator.populate(s, t));
by
getPopulators() //
.parallelStream() //
.filter(Objects::nonNull) //
.forEach(populator -> populator.populate(s, t));
I haven't tried it, it can work but with parallelism it very easy to introduce a bug.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.