diff --git a/src/wpool.erl b/src/wpool.erl index 47fbe93..ba756cd 100644 --- a/src/wpool.erl +++ b/src/wpool.erl @@ -11,46 +11,48 @@ % KIND, either express or implied. See the License for the % specific language governing permissions and limitations % under the License. -%% @author Fernando Benavides -%% @doc Worker pool main interface. -%% -%% Use functions provided by this module to manage your pools of workers. -%% -%%

Starting the application

-%% Worker Pool is an Erlang application that can be started using the functions in the -%% `application' module. For convenience, `wpool:start/0' and `wpool:stop/0' are also provided. -%% -%%

Starting a Pool

-%% -%% To start a new worker pool, you can either -%% -%% -%%

Stopping a Pool

-%% To stop a pool, just use `wpool:stop_pool/1' or `wpool:stop_sup_pool/1' according to how you -%% started the pool. -%% -%%

Using the Workers

-%% -%% Since the workers are `gen_server's, messages can be `call'ed or `cast'ed to them. To do that you -%% can use `wpool:call' and `wpool:cast' as you would use the equivalent functions on `gen_server'. -%% -%%

Choosing a Strategy

-%% -%% Beyond the regular parameters for `gen_server', wpool also provides an extra optional parameter -%% Strategy The strategy used to pick up the worker to perform the task. If not provided, -%% the result of `wpool:default_strategy/0' is used. -%% -%% The available strategies are defined in the `t:wpool:strategy/0' type. -%% -%%

Watching a Pool

-%% Wpool provides a way to get live statistics about a pool. To do that, you can use -%% `wpool:stats/1'. +%%% @doc Worker pool main interface. +%%% +%%% Use functions provided by this module to manage your pools of workers. +%%% +%%%

Starting the application

+%%% Worker Pool is an Erlang application that can be started using the functions in the +%%% `application' module. For convenience, `wpool:start/0' and `wpool:stop/0' are also provided. +%%% +%%%

Starting a Pool

+%%% +%%% To start a new worker pool, you can either +%%% +%%% +%%%

Stopping a Pool

+%%% To stop a pool, just use `wpool:stop_pool/1' or `wpool:stop_sup_pool/1' according to how you +%%% started the pool. +%%% +%%%

Using the Workers

+%%% +%%% Since the workers are `gen_server's, messages can be `call'ed or `cast'ed to them. To do that +%%% you can use `wpool:call' and `wpool:cast' as you would use the equivalent functions on +%%% `gen_server'. +%%% +%%%

Choosing a Strategy

+%%% +%%% Beyond the regular parameters for `gen_server', wpool also provides an extra optional parameter +%%% Strategy The strategy used to pick up the worker to perform the task. If not provided, +%%% the result of `wpool:default_strategy/0' is used. +%%% +%%% The available strategies are defined in the `t:wpool:strategy/0' type. +%%% +%%%

Watching a Pool

+%%% Wpool provides a way to get live statistics about a pool. To do that, you can use +%%% `wpool:stats/1'. -module(wpool). -behaviour(application). diff --git a/src/wpool_pool.erl b/src/wpool_pool.erl index e9d3412..3314bda 100644 --- a/src/wpool_pool.erl +++ b/src/wpool_pool.erl @@ -11,16 +11,14 @@ % KIND, either express or implied. See the License for the % specific language governing permissions and limitations % under the License. -%% @author Fernando Benavides -%% @doc Top supervisor for a `worker_pool'. -%% -%% This supervisor supervises `wpool_process_sup' (which is the worker's supervisor) together with -%% auxiliary servers that help keep the whole pool running and in order. -%% -%% -%% The strategy of this supervisor must be `one_for_all' but the intensity and period may be changed -%% from their defaults by the `t:wpool:pool_sup_intensity()' and `t:wpool:pool_sup_intensity()' -%% options respectively. +%%% @doc Top supervisor for a `worker_pool'. +%%% +%%% This supervisor supervises `wpool_process_sup' (which is the worker's supervisor) together with +%%% auxiliary servers that help keep the whole pool running and in order. +%%% +%%% The strategy of this supervisor must be `one_for_all' but the intensity and period may be +%%% changed from their defaults by the `t:wpool:pool_sup_intensity()' and +%%% `t:wpool:pool_sup_intensity()' options respectively. -module(wpool_pool). -behaviour(supervisor). diff --git a/src/wpool_process.erl b/src/wpool_process.erl index f72524c..dff3d84 100644 --- a/src/wpool_process.erl +++ b/src/wpool_process.erl @@ -12,7 +12,6 @@ % specific language governing permissions and limitations % under the License. %%% @private -%%% @author Fernando Benavides %%% @doc Decorator over `gen_server' that lets `wpool_pool' %%% control certain aspects of the execution -module(wpool_process). diff --git a/src/wpool_process_sup.erl b/src/wpool_process_sup.erl index 9700922..10dc9e6 100644 --- a/src/wpool_process_sup.erl +++ b/src/wpool_process_sup.erl @@ -11,7 +11,7 @@ % KIND, either express or implied. See the License for the % specific language governing permissions and limitations % under the License. -%% @doc This is the supervisor that supervises the `gen_server' workers specifically. +%%% @doc This is the supervisor that supervises the `gen_server' workers specifically. -module(wpool_process_sup). -behaviour(supervisor). diff --git a/src/wpool_utils.erl b/src/wpool_utils.erl index 9c4c623..25bd93a 100644 --- a/src/wpool_utils.erl +++ b/src/wpool_utils.erl @@ -11,7 +11,6 @@ % KIND, either express or implied. See the License for the % specific language governing permissions and limitations % under the License. -%%% @author Felipe Ripoll %%% @doc Common functions for wpool_process and other modules. -module(wpool_utils). diff --git a/src/wpool_worker.erl b/src/wpool_worker.erl index d6d6c7b..3bc9176 100644 --- a/src/wpool_worker.erl +++ b/src/wpool_worker.erl @@ -11,10 +11,9 @@ % KIND, either express or implied. See the License for the % specific language governing permissions and limitations % under the License. -%% @author Fernando Benavides -%% @doc Default instance for `wpool_process' -%% -%% It is a module that implements a very simple RPC-like interface. +%%% @doc Default instance for `wpool_process' +%%% +%%% It is a module that implements a very simple RPC-like interface. -module(wpool_worker). -behaviour(gen_server).