Scanning a large range with Locality API hangs

Thank you for the fast answer.

I read the topic Large Range Scans - avoid 5s limit
and I saw this snipped. Its problem is processing of each key sequencionally.

I’d like to iterate subranges (not individual keys) sequencially and to start processing of each subrange in parallel with limitation of the number of ranges are processed simultaneously. So sometimes I have to wait until some ranges finished so it takes some time and makes getBoundaryKeys.hasNext hangs.