worker_pool
worker_pool copied to clipboard
Implement wpool:broadcall/2 function
Enable worker_pool to perform a synchronous
call to every worker within the given pool, wait for the responses and send them back to the caller, e.g:
-spec broadcall(name(), Call) -> [response()].
broadcall(Sup, Call) ->
Workers = all_workers(Sup),
[wpool_process:call(Worker, Call, Timeout) || Worker <- Workers].