TaskBunny v0.2.2 TaskBunny.WorkerSupervisor

Supervises all TaskBunny workers.

You don’t have to call or start the Supervisor explicity. It will be automatically started by application and configure child workers based on configuration file.

It also provides graceful_halt/1 and graceful_halt/2 that allow you to shutdown the worker processes safely.

Summary

Functions

Similar to graceful_halt/2 but gets pid from module name

Halts the job pocessing on workers gracefully. It makes workers to stop processing new jobs and waits for jobs currently running to finish

Functions

graceful_halt(timeout)
graceful_halt(integer) :: :ok | {:error, any}

Similar to graceful_halt/2 but gets pid from module name.

graceful_halt(pid, timeout)
graceful_halt(pid | nil, integer) :: :ok | {:error, any}

Halts the job pocessing on workers gracefully. It makes workers to stop processing new jobs and waits for jobs currently running to finish.

Note: It doesn’t terminate any worker processes. The worker and worker supervisor processes will continue existing but won’t consume any new messages. To resume it, terminate the worker supervisor then the main supervisor will start new processes.