What is a design pattern in erlang in terms of gen_server to create a fixed number of worker processes and feed them with ‘jobs’ to perform some actions ? Each worker process talks with an external service which has connection limits. Number of ‘jobs’ considered to be unlimited. In C I’d do that by creating a pool of worker threads and an async. queue (with limited capacity) guarded by mutex to feed the pool with jobs from the submitter.
Share
Have the gen_server put a monitor on your worker processes, and when one dies (either job finished, or crash) spawn another one.