module Marmot

Overview

Marmot is a scheduler, use it to schedule tasks.

Extended Modules

Defined in:

marmot.cr

Constant Summary

VERSION = "0.1.1"

Instance Method Summary

Instance Method Detail

def cancel_all_tasks : Nil #

Cancels all the tasks.


[View source]
def cron(hour, minute, second = 0, &block : Callback) : Task #

Runs a task every day at hour and minute.


[View source]
def repeat(span : Time::Span, first_run = false, &block : Callback) : Task #

Runs a task every given span.

If first run is true, it will run as soon as the scheduler runs. Else it will wait span time, then run a first time.


[View source]
def run : Nil #

Starts scheduling the tasks.

This blocks until #stop is called.


[View source]
def stop #

Stops scheduling the tasks.


[View source]