marmot
Version, currently 0.1.08 versions
github.com/erdnaxeli/marmot
A scheduler lib for Crystal.
Nothing has been indexed for 0.1.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
marmot:
github: erdnaxeli/marmot
version: ~> 0.1.0Then run:
shards installshard.yml
No shard.yml has been indexed for 0.1.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
marmot
Marmot is a scheduler, use it to schedule tasks.
The most detailled documentation is the api doc.
Installation
-
Add the dependency to your
shard.yml:dependencies: marmot: github: erdnaxeli/marmot -
Run
shards install
Usage
require "marmot"
# This task will repeat every 15 minutes.
repeat_task = Marmot.every(15.minutes) { puts Time.local }
# This task will run every day at 15:28:43, and will cancel the previous task.
Marmot.every(:day, hour: 15, minute: 28, second: 43) do
puts "It is 15:28:43: #{Time.local}"
repeat_task.cancel
end
times = 0
channel = Channel(String).new
# This task will run every 10 seconds and will cancel itself after 10 runs.
Marmot.every(10.seconds) do |task|
times += 1
channel.send("#{times} times")
if times == 10
task.cancel
channel.close
end
end
Marmot.on(channel) do |task|
if value = task.as(Marmot::OnChannelTask).value
puts value
else
puts "The task was canceled"
end
end
# Start the scheduler.
Marmot.run
Debug
You can set the env var MARMOT_DEBUG to any value to make marmot outputs debug logs.
Development
Don't forget to run the test.
As they deal with timing, they could fail if your computer is busy. Do not hesitate to run then many times if that happens.
Contributing
- Fork it (https://github.com/erdnaxeli/marmot/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
- erdnaxeli - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.0- Tagged
- Apr 18, 2021
- Commit
47aba2ff9dfe- Indexed
- not yet
Dependents
Repository
github.com/erdnaxeli/marmot
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 18, 2026
- Synced
- Aug 18, 2026
- Versions
- 8