That's actually a decent way, just make sure you are using proc_lib:spawn_link(...)
instead of erlang:spawn_link(...)
(to store ancestors for supervision tree traversing, and for more verbose error logs).
And, of course, you might want to make restart strategy for all workers set to temporary
or transient
, depending on what you are going to do in case of worker failure (restart the worker and attempt to do the job once again or discard the job in case of any failures).