agent_pool
agent_pool
A shard to handle agent pooling with reusable connections and connection timeouts.
The AgentPool is based on the pool in use by crystal-db.
Installation
-
Add the dependency to your
shard.yml
:dependencies: agent_pool: github: aluminumio/agent_pool
-
Run
shards install
Usage
require "agent_pool"
pool = AgentPool::AgentPool(Agent).new {|destination| Agent.new(destination) }
agent = pool.checkout("destination")
spawn do
agent.do_work("abcd")
pool.release(agent, "destination")
end
TODO: Write usage instructions here
Development
TODO: Handle timeouts raised by agents.
Contributing
- Fork it (https://github.com/aluminumio/agent_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
- usiegl00 - creator and maintainer
Repository
agent_pool
Owner
Statistic
- 0
- 1
- 0
- 0
- 1
- over 2 years ago
- June 8, 2022
License
MIT License
Links
Synced at
Thu, 21 Nov 2024 16:45:08 GMT
Languages