concept sublist in category kotlin
appears as: sublists, sublist, sublists

This is an excerpt from Manning's book The Joy of Kotlin.
First, you must define the number of sublists you want to use and divide the list accordingly:
divide(1024)Then you’ll map the list of sublists with a function that’ll submit a task to the
ExecutorService. This task consists of folding each sublist and returning aFutureinstance. The list ofFutureinstances is mapped to a function callinggeton eachFutureto produce a list of results (one for each sublist). You must catch the potential exceptions. Eventually, the list of results is folded with the second function, and the result is returned in aSuccess. In the case of an exception, aFailureis returned: