crystal-agency
Agency
Crystal language shard which provides simple traits to be included for agents that can start and stop, and supervisors which manage a list of agents.
Installation
-
Add the dependency to your
shard.yml:dependencies: crystal-agency: github: lachlan/crystal-agency -
Run
shards install
Usage
require "agency"
class ExampleAgent
include Agency::Agent
def run : Nil
count = 1
while started?
Log.info { "count = #{count}" }
count += 1
sleep 1.second
end
end
end
class ExampleSupervisor
include Agency::Supervisor
end
agent = ExampleAgent.new
supervisor = ExampleSupervisor.new
supervisor << agent # supervise the agent with the supervisor
supervisor.start # starts self and all managed agents and waits for completion
Contributing
- Fork it (https://github.com/lachlan/crystal-agency/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
- Lachlan Dowding - creator and maintainer
Repository
crystal-agency
Owner
Statistic
- 0
- 0
- 0
- 0
- 0
- about 8 hours ago
- August 19, 2026
License
MIT License
Links
Synced at
Wed, 19 Aug 2026 04:45:07 GMT
Languages