Behaviours: supervisor.
Authors: Fernando Benavides (elbrujohalcon@inaka.net).
| available_worker/2 | Picks the first available worker. |
| best_worker/1 | Picks the worker with the smaller queue of messages. |
| cast_to_available_worker/2 | Casts a message to the first available worker. |
| create_table/0 | Creates the ets table that will hold the information about active pools. |
| hash_worker/2 | Picks a worker base on a hash result. |
| next_worker/1 | Picks the next worker in a round robin fashion. |
| random_worker/1 | Picks a random worker. |
| start_link/2 | Starts a supervisor with several wpool_processes as its children. |
| stats/1 | Retrieves a snapshot of the pool stats. |
| worker_names/1 | Returns the names of the workers in the pool. |
| wpool_size/1 | the number of workers in the pool. |
available_worker(Sup::wpool:name(), Timeout::timeout()) -> atom()
throws no_workers
Picks the first available worker. If all workers are busy, waits for Timeout ms until one is free
best_worker(Sup::wpool:name()) -> atom()
throws no_workers
Picks the worker with the smaller queue of messages.
cast_to_available_worker(Sup::wpool:name(), Cast::term()) -> ok
Casts a message to the first available worker. Since we can wait forever for a wpool:cast to be delivered but we don't want the caller to be blocked, this function just forwards the cast when it gets the worker
create_table() -> ok
Creates the ets table that will hold the information about active pools
hash_worker(Sup::wpool:name(), HashKey::term()) -> atom()
throws no_workers
Picks a worker base on a hash result.
phash2(Term, Range)returns hash = integer, 0 <= hash < Range so
1must be added
next_worker(Sup::wpool:name()) -> atom()
throws no_workers
Picks the next worker in a round robin fashion
random_worker(Sup::wpool:name()) -> atom()
throws no_workers
Picks a random worker
start_link(Name::wpool:name(), Options::[wpool:option()]) -> {ok, pid()} | {error, {already_started, pid()} | term()}
Starts a supervisor with several wpool_processes as its children
stats(Sup::wpool:name()) -> wpool:stats()
throws no_workers
Retrieves a snapshot of the pool stats
worker_names(Pool_Name::wpool:name()) -> [atom()]
Returns the names of the workers in the pool
wpool_size(Name::atom()) -> non_neg_integer() | undefined
the number of workers in the pool
Generated by EDoc, Nov 10 2015, 15:43:49.