class AsyncThreadsService
API_ENDPOINT = "https://api.chucknorris.io/jokes/random".freeze
def self.call(requests_count)
jokes = Queue.new
threads = []
requests_count.times do
thread = Thread.new do
jokes << DataRequester.new(API_ENDPOINT).call
end
threads << thread
end
threads.each(&:join)
jokes
end
end