Panos
11/16/2022, 7:09 PMExecutors.newFixedThreadPool(8)
to create a pool of threads that are meant to indefinitely process incoming SQS messages. It seems from my tests that tasks are submitted constantly to the pool without waiting for one or more of the 8 allocated threads to finish. I’m not using shutdown as I do not want to shutdown this pool but instead use it indefinitely but wait when it is full. Any ideas?Chris Lee
11/16/2022, 7:24 PMnewFixedThreadPool
uses an unbounded queue for submitted tasks. You can submit all the tasks and then shutdown the pool and await termination (blocking until all are complete). If you desire different behaviour you can change the queueing strategy here. Or use Kotlin coroutines for lighter-weight concurrency.Panos
11/16/2022, 7:26 PMDispatchers.IO.limitedParallelism
atm, but despite being at 1.6.3 Idea complains of it not existing….gildor
11/17/2022, 3:06 AMgildor
11/17/2022, 3:09 AMbut wait when it is fullCould you explain a bit more? Do you want to prevent adding new tasks to the queue if it already has 8? And suspend for this?