worker_pool
worker_pool
Allocates a minimum number fibers for performing work
- grows and shrinks the pool as required
- reduces the overhead of allocating fibers for repetitive, bursty, work
- handles long running tasks like websockets
Installation
-
Add the dependency to your
shard.yml
:dependencies: worker_pool: github: spider-gazelle/worker_pool
-
Run
shards install
Usage
require "worker_pool"
pool = WorkerPool.new(100)
100.times do
pool.perform { my_task }
end
Contributing
- Fork it (https://github.com/spider-gazelle/worker_pool/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Stephen von Takach - creator and maintainer