Method: Deliver::AppScreenshotIterator#each_app_screenshot_set
- Defined in:
- deliver/lib/deliver/app_screenshot_iterator.rb
#each_app_screenshot_set(localizations = @localizations) {|localization, app_screenshot_set| ... } ⇒ Object
Iterate app_screenshot_set over localizations
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'deliver/lib/deliver/app_screenshot_iterator.rb', line 16 def each_app_screenshot_set(localizations = @localizations, &block) return enum_for(__method__, localizations) unless block_given? # Collect app_screenshot_sets from localizations in parallel but # limit the number of threads working at a time with using `lazy` and `force` controls # to not attack App Store Connect results = localizations.each_slice(NUMBER_OF_THREADS).lazy.map do |localizations_grouped| localizations_grouped.map do |localization| Thread.new do [localization, localization.get_app_screenshot_sets] end end end.flat_map do |threads| threads.map { |t| t.join.value } end.force results.each do |localization, app_screenshot_sets| app_screenshot_sets.each do |app_screenshot_set| yield(localization, app_screenshot_set) end end end |