ticker
Version, currently main branch1 version
- main branchlatestMar 11, 2026
github.com/jgaskins/ticker
An `Enumerable` ticker object for Crystal
2 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
ticker:
github: jgaskins/ticker
branch: mainmain is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
>= 1.18.2- License
- MIT
- Author
- Jamie Gaskins
Dependencies
Development Dependencies
- pg*github: will/crystal-pgdev
README
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
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
main- Seen
- Mar 11, 2026
- Crystal
>= 1.18.2- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/jgaskins/ticker
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 13, 2026
- Synced
- Aug 13, 2026
- Versions
- 1