stringer-rss/stringer

View on GitHub
app/commands/feed/fetch_all_for_user.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

require "thread/pool"

module Feed::FetchAllForUser
  def self.call(user)
    pool = Thread.pool(10)

    user.feeds.find_each { |feed| pool.process { Feed::FetchOne.call(feed) } }

    pool.shutdown
  end
end