ticker
ticker
A Ticker is an object that yields a Time::Instant on an interval.
Installation
-
Add the dependency to your
shard.yml:dependencies: ticker: github: jgaskins/ticker -
Run
shards install
Usage
ticker = Ticker.new(interval: 5.seconds)
ticker.each do
# work to be done every 5 seconds
end
Example: Polling the database for jobs
There is an example showing how to use a Ticker to poll Postgres for background jobs inside examples/job_polling.cr.
Contributing
- Fork it (https://github.com/jgaskins/ticker/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
- Jamie Gaskins - creator and maintainer
Repository
ticker
Owner
Statistic
- 0
- 0
- 0
- 0
- 1
- 19 days ago
- March 11, 2026
License
MIT License
Links
Synced at
Wed, 11 Mar 2026 03:07:11 GMT
Languages