ursm/activejob-google_cloud_pubsub

Too many thread pools

mattes opened this issue · 2 comments

google-cloud-pubsub is starting a thread pool to process incoming messages:

            @stream_pool.map do |stream|
              Thread.new { stream.start }
            end

activejob-google_cloud_pubsub is doing the same:

pool = Concurrent::ThreadPoolExecutor.new(min_threads: @min_threads, max_threads: @max_threads, max_queue: -1)

... effectively duplicating the efforts of google-cloud-pubsub, if I'm not mistaken?

ursm commented

Exactly. Earlier versions of google-cloud-pubsub did not use thread pools, but now it's an extra feature. I am going to fix this. Thank you very much for your attention!

could #6 be the solution for this issue ?