@@ -11,8 +11,8 @@ require "./tasks"
1111# * when a value is available on a channel (`Marmot.on`)
1212#
1313# Tasks are all executed on the same fiber.
14- # This means two things: first, you don't have to worry about concurrency
15- # (your tasks can share objects which does not support concurrency, like
14+ # This means two things: first, you don't have to worry about concurrency
15+ # (your tasks can share objects which do not support concurrency, like
1616# `HTTP::Client`), and second, they must not block (too much).
1717# If you want to execute jobs concurrently, you must spawn a new fiber inside your
1818# tasks.
@@ -38,7 +38,7 @@ require "./tasks"
3838# Their next runs will be triggered at the time before the clock changes, but the
3939# next ones will be correctly scheduled.
4040module Marmot
41- VERSION = " 0.3.1 "
41+ VERSION = " 0.4.0 "
4242
4343 alias Callback = Proc (Task , Nil )
4444
@@ -75,10 +75,10 @@ module Marmot
7575 # Runs a task every *span* at the given *day*, *hour*, *minute* and *second*.
7676 #
7777 # ```
78- # Marmot.every(:hour, hour: 16, minute: 30, second: 30) # will run every hour at 30:30 (the hour parameter is ignored)
79- # Marmot.every(:day, hour: 15) { ... } # will run every day at 15:00:00
80- # Marmot.every(:month, day: 15) { ... } # will run every month at midnight
81- # Marmot.every(:month, day: 31) { ... } # will run every month THAT HAVE a 31th day at midnight
78+ # Marmot.every(:hour, hour: 16, minute: 30, second: 30) # will run every hour at 30:30 (the hour parameter is ignored)
79+ # Marmot.every(:day, hour: 15) { ... } # will run every day at 15:00:00
80+ # Marmot.every(:month, day: 15) { ... } # will run every month at midnight
81+ # Marmot.every(:month, day: 31) { ... } # will run every month THAT HAVE a 31th day at midnight
8282 # ```
8383 def every (span : Symbol , * , day = 1 , hour = 0 , minute = 0 , second = 0 , & block : Callback ) : Task
8484 Log .debug { " New task to run every #{ span } at #{ hour } :#{ minute } :#{ second } " }
@@ -115,7 +115,7 @@ module Marmot
115115 remove_canceled_tasks
116116
117117 if @@tasks .size == 0
118- Log .debug { " No task to run! Stopping." }
118+ Log .debug { " No task to run! Stopping." }
119119 return
120120 end
121121
0 commit comments