Skip to content

Commit

Permalink
Bump version to v0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
erdnaxeli committed Dec 27, 2020
1 parent e08827e commit 298702a
Show file tree
Hide file tree
Showing 12 changed files with 114 additions and 13 deletions.
35 changes: 35 additions & 0 deletions docs/Marmot.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,27 @@ <h2>
Defined in:
</h2>


<a href="https://github.com/erdnaxeli/marmot/blob/e08827ec5a6846f953410a8fc36ac3534d89d2ab/src/log.cr#L1" target="_blank">
log.cr
</a>

<br/>


<a href="https://github.com/erdnaxeli/marmot/blob/e08827ec5a6846f953410a8fc36ac3534d89d2ab/src/marmot.cr#L40" target="_blank">
marmot.cr
</a>

<br/>


<a href="https://github.com/erdnaxeli/marmot/blob/e08827ec5a6846f953410a8fc36ac3534d89d2ab/src/tasks.cr#L3" target="_blank">
tasks.cr
</a>

<br/>




Expand Down Expand Up @@ -319,6 +340,8 @@ <h2>
<br/>
<div>

[<a href="https://github.com/erdnaxeli/marmot/blob/e08827ec5a6846f953410a8fc36ac3534d89d2ab/src/marmot.cr#L61" target="_blank">View source</a>]

</div>
</div>

Expand All @@ -338,6 +361,8 @@ <h2>
<br/>
<div>

[<a href="https://github.com/erdnaxeli/marmot/blob/e08827ec5a6846f953410a8fc36ac3534d89d2ab/src/marmot.cr#L103" target="_blank">View source</a>]

</div>
</div>

Expand All @@ -360,6 +385,8 @@ <h2>
<br/>
<div>

[<a href="https://github.com/erdnaxeli/marmot/blob/e08827ec5a6846f953410a8fc36ac3534d89d2ab/src/marmot.cr#L70" target="_blank">View source</a>]

</div>
</div>

Expand All @@ -384,6 +411,8 @@ <h2>
<br/>
<div>

[<a href="https://github.com/erdnaxeli/marmot/blob/e08827ec5a6846f953410a8fc36ac3534d89d2ab/src/marmot.cr#L83" target="_blank">View source</a>]

</div>
</div>

Expand All @@ -409,6 +438,8 @@ <h2>
<br/>
<div>

[<a href="https://github.com/erdnaxeli/marmot/blob/e08827ec5a6846f953410a8fc36ac3534d89d2ab/src/marmot.cr#L97" target="_blank">View source</a>]

</div>
</div>

Expand All @@ -430,6 +461,8 @@ <h2>
<br/>
<div>

[<a href="https://github.com/erdnaxeli/marmot/blob/e08827ec5a6846f953410a8fc36ac3534d89d2ab/src/marmot.cr#L110" target="_blank">View source</a>]

</div>
</div>

Expand All @@ -449,6 +482,8 @@ <h2>
<br/>
<div>

[<a href="https://github.com/erdnaxeli/marmot/blob/e08827ec5a6846f953410a8fc36ac3534d89d2ab/src/marmot.cr#L149" target="_blank">View source</a>]

</div>
</div>

Expand Down
9 changes: 9 additions & 0 deletions docs/Marmot/AtTask.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ <h2>
Defined in:
</h2>


<a href="https://github.com/erdnaxeli/marmot/blob/e08827ec5a6846f953410a8fc36ac3534d89d2ab/src/tasks.cr#L50" target="_blank">
tasks.cr
</a>

<br/>




Expand Down Expand Up @@ -250,6 +257,8 @@ <h2>
<br/>
<div>

[<a href="https://github.com/erdnaxeli/marmot/blob/e08827ec5a6846f953410a8fc36ac3534d89d2ab/src/tasks.cr#L53" target="_blank">View source</a>]

</div>
</div>

Expand Down
7 changes: 7 additions & 0 deletions docs/Marmot/Callback.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,13 @@ <h2>
Defined in:
</h2>


<a href="https://github.com/erdnaxeli/marmot/blob/e08827ec5a6846f953410a8fc36ac3534d89d2ab/src/marmot.cr#L43" target="_blank">
marmot.cr
</a>

<br/>




Expand Down
9 changes: 9 additions & 0 deletions docs/Marmot/CronTask.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ <h2>
Defined in:
</h2>


<a href="https://github.com/erdnaxeli/marmot/blob/e08827ec5a6846f953410a8fc36ac3534d89d2ab/src/tasks.cr#L67" target="_blank">
tasks.cr
</a>

<br/>




Expand Down Expand Up @@ -231,6 +238,8 @@ <h2>
<br/>
<div>

[<a href="https://github.com/erdnaxeli/marmot/blob/e08827ec5a6846f953410a8fc36ac3534d89d2ab/src/tasks.cr#L68" target="_blank">View source</a>]

</div>
</div>

Expand Down
15 changes: 13 additions & 2 deletions docs/Marmot/OnChannelTask.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ <h2>
Defined in:
</h2>


<a href="https://github.com/erdnaxeli/marmot/blob/e08827ec5a6846f953410a8fc36ac3534d89d2ab/src/tasks.cr#L145" target="_blank">
tasks.cr
</a>

<br/>




Expand Down Expand Up @@ -250,6 +257,8 @@ <h2>
<br/>
<div>

[<a href="https://github.com/erdnaxeli/marmot/blob/e08827ec5a6846f953410a8fc36ac3534d89d2ab/src/tasks.cr#L155" target="_blank">View source</a>]

</div>
</div>

Expand Down Expand Up @@ -279,13 +288,15 @@ <h2>

<p>Gets the value received on the channel.</p>

<p>If the channel is closed while waiting, a <code>nil</code> value will saved here, and
the task will run one last time.</p>
<p>If the channel is closed a <code>nil</code> value will saved here, and the task will
run one last time.</p>
</div>

<br/>
<div>

[<a href="https://github.com/erdnaxeli/marmot/blob/e08827ec5a6846f953410a8fc36ac3534d89d2ab/src/tasks.cr#L153" target="_blank">View source</a>]

</div>
</div>

Expand Down
9 changes: 9 additions & 0 deletions docs/Marmot/RepeatTask.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ <h2>
Defined in:
</h2>


<a href="https://github.com/erdnaxeli/marmot/blob/e08827ec5a6846f953410a8fc36ac3534d89d2ab/src/tasks.cr#L186" target="_blank">
tasks.cr
</a>

<br/>




Expand Down Expand Up @@ -250,6 +257,8 @@ <h2>
<br/>
<div>

[<a href="https://github.com/erdnaxeli/marmot/blob/e08827ec5a6846f953410a8fc36ac3534d89d2ab/src/tasks.cr#L189" target="_blank">View source</a>]

</div>
</div>

Expand Down
11 changes: 11 additions & 0 deletions docs/Marmot/Task.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@ <h2>
Defined in:
</h2>


<a href="https://github.com/erdnaxeli/marmot/blob/e08827ec5a6846f953410a8fc36ac3534d89d2ab/src/tasks.cr#L4" target="_blank">
tasks.cr
</a>

<br/>




Expand Down Expand Up @@ -266,6 +273,8 @@ <h2>
<br/>
<div>

[<a href="https://github.com/erdnaxeli/marmot/blob/e08827ec5a6846f953410a8fc36ac3534d89d2ab/src/tasks.cr#L15" target="_blank">View source</a>]

</div>
</div>

Expand All @@ -285,6 +294,8 @@ <h2>
<br/>
<div>

[<a href="https://github.com/erdnaxeli/marmot/blob/e08827ec5a6846f953410a8fc36ac3534d89d2ab/src/tasks.cr#L21" target="_blank">View source</a>]

</div>
</div>

Expand Down
24 changes: 17 additions & 7 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,22 +134,32 @@ <h2><a id="usage" class="anchor" href="#usage">

<pre><code class="language-crystal"><span class="k">require</span> <span class="s">&quot;marmot&quot;</span>

repetitions

<span class="c"># This task will repeat every 15 minutes.</span>
repeat_task <span class="o">=</span> <span class="t">Marmot</span>.repeat(<span class="n">15</span>.minutes) { puts <span class="t">Time</span>.local }
repeat_task <span class="o">=</span> <span class="t">Marmot</span>.every(<span class="n">15</span>.minutes) { puts <span class="t">Time</span>.local }
<span class="c"># This task will run every day at 15:28:43, and will cancel the previous task.</span>
<span class="t">Marmot</span>.cron(hour: <span class="n">15</span>, minute: <span class="n">28</span>, second: <span class="n">43</span>) <span class="k">do</span>
<span class="t">Marmot</span>.every(<span class="n">:day</span>, hour: <span class="n">15</span>, minute: <span class="n">28</span>, second: <span class="n">43</span>) <span class="k">do</span>
puts <span class="s">&quot;It is 15:28:43: </span><span class="i">#{</span><span class="t">Time</span>.local<span class="i">}</span><span class="s">&quot;</span>
repeat_task.cancel
<span class="k">end</span>

times <span class="o">=</span> <span class="n">0</span>
channel <span class="o">=</span> <span class="t">Channel</span>(<span class="t">String</span>).<span class="k">new</span>
<span class="c"># This task will run every 10 seconds and will cancel itself after 10 runs.</span>
<span class="t">Marmot</span>.repeat(<span class="n">10</span>.seconds) <span class="k">do</span> <span class="o">|</span>task<span class="o">|</span>
<span class="t">Marmot</span>.every(<span class="n">10</span>.seconds) <span class="k">do</span> <span class="o">|</span>task<span class="o">|</span>
times += <span class="n">1</span>
puts <span class="s">&quot;</span><span class="i">#{</span>times<span class="i">}</span><span class="s"> times&quot;</span>
task.cancel <span class="k">if</span> times <span class="o">=</span> <span class="n">10</span>
channel.send(<span class="s">&quot;</span><span class="i">#{</span>times<span class="i">}</span><span class="s"> times&quot;</span>)
<span class="k">if</span> times <span class="o">==</span> <span class="n">10</span>
task.cancel
channel.close
<span class="k">end</span>
<span class="k">end</span>

<span class="t">Marmot</span>.on(channel) <span class="k">do</span> <span class="o">|</span>task<span class="o">|</span>
<span class="k">if</span> value <span class="o">=</span> task.<span class="k">as</span>(<span class="t">Marmot</span><span class="t">::</span><span class="t">OnChannelTask</span>).value
puts value
<span class="k">else</span>
puts <span class="s">&quot;The task was canceled&quot;</span>
<span class="k">end</span>
<span class="k">end</span>

<span class="c"># Start the scheduler.</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/search-index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: marmot
version: 0.3.0
version: 0.3.1

authors:
- Alexandre Morignot <erdnaxeli@cervoi.se>
Expand Down
2 changes: 1 addition & 1 deletion src/marmot.cr
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ require "./tasks"
# Their next runs will be triggered at the time before the clock changes, but the
# next ones will be correctly scheduled.
module Marmot
VERSION = "0.3.0"
VERSION = "0.3.1"

alias Callback = Proc(Task, Nil)

Expand Down

0 comments on commit 298702a

Please sign in to comment.