lib/manga-downloadr/concurrency.rb
# this method is the same as the above but sequential, without Threads
# it's not to be used in the application, just to be used as a baseline for benchmark
this method is the same as the above but sequential, without Threads
it's not to be used in the application, just to be used as a baseline for benchmark
this method is the same as the above but sequential without Threads it ' s not to be used in the application just to be used as a baseline for benchmark
def fetch_sequential(collection, &block)
      results = []
      engine  = @turn_on_engine ? @engine_klass.new(@config.domain, @config.cache_http) : nil
      collection&.each_slice(@config.download_batch_size) do |batch|
        batch.each do |item|
          batch_results = block.call(item, engine)&.flatten
          results += ( batch_results || [])
        end
      end
      results
    end
def fetch_sequential ( collection , & block ) results = [ ] engine = @turn_on_engine ? @engine_klass . new ( @config . domain , @config . cache_http ) : nil collection &. each_slice ( @config . download_batch_size ) do | batch | batch . each do | item | batch_results = block . call ( item , engine ) &. flatten results += ( batch_results || [ ] ) end end results end
this method is the same as the above but sequential, without Threads
it's not to be used in the application, just to be used as a baseline for benchmark
this method is the same as the above but sequential without Threads it ' s not to be used in the application just to be used as a baseline for benchmark
collection
<not_specific>
block
<not_specific>