tigertext/worker_pool — pull request #10 by elbrujohalcon (2013-08-09 15:29:26+00:00)
Title: Issue tigertext/xmpp#1388: New Strategy: available_worker

Issue tigertext/xmpp#1388: New Strategy: available_worker.

The new strategy was tested using the following commands:
```erlang
12> mk(), wpool_bench:run_tasks([{large, 99}, {small, 901}], random_worker, [{workers, 100}]).
99.93604328523863
13> mk(), wpool_bench:run_tasks([{large, 99}, {small, 901}], best_worker, [{workers, 100}]).
66.64304994450612
14> mk(), wpool_bench:run_tasks([{large, 99}, {small, 901}], next_worker, [{workers, 100}]).
33.33676470588235
15> mk(), wpool_bench:run_tasks([{large, 99}, {small, 901}], available_worker, [{workers, 100}]).
0.035786903440621604
16>
16> mk(), wpool_bench:run_tasks([{small, 1000}], random_worker, [{workers, 100}]).
0.036285
17> mk(), wpool_bench:run_tasks([{small, 1000}], best_worker, [{workers, 100}]).
0.03574200000000003
18> mk(), wpool_bench:run_tasks([{small, 1000}], next_worker, [{workers, 100}]).
0.029860999999999933
19> mk(), wpool_bench:run_tasks([{small, 1000}], available_worker, [{workers, 100}]).
0.03781900000000024
```

As you can see there:
- when some large tasks are blocking some workers, the new strategy is way faster than the previous ones
- when all the tasks are small, it's not much worst than them

So, if @mhald has no issue with it, I would like to set this strategy as the default one, instead of ``random_worker``