SuperWorker.Supervisor.Group (SuperWorker v0.1.0)

View Source

Documentation for SuperWorker.Supervisor.Group.

Summary

Functions

A internal function. Add a worker to the group.

Check, validate and convert key-value pairs to struct.

Get all workers from the group.

Get worker from the group.

A internal function. Restart a worker in the group.

Check if worker exists in the group.

Types

t()

@type t() :: %SuperWorker.Supervisor.Group{
  id: any(),
  partition: atom(),
  restart_strategy: atom(),
  supervisor: atom()
}

Functions

add_worker(group, worker)

A internal function. Add a worker to the group.

broadcast(group, message)

check_options(opts)

@spec check_options([keyword()]) ::
  {:ok,
   %SuperWorker.Supervisor.Group{
     id: term(),
     partition: term(),
     restart_strategy: term(),
     supervisor: term()
   }}
  | {:error, atom() | {atom(), any()}}

Check, validate and convert key-value pairs to struct.

count_workers(group)

get_all_workers(group)

Get all workers from the group.

get_worker(group, worker_id)

Get worker from the group.

kill_all_workers(group, reason \\ :kill)

kill_worker(group, worker, reason)

remove_worker(group, worker_id)

restart_worker(group, worker)

A internal function. Restart a worker in the group.

send_message(group, worker_id, message)

worker_exists?(group, worker_id)

Check if worker exists in the group.