-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cron style scheduling #115
Comments
We can support a cron-like interval format. We can even re-use some code from https://github.com/c-rack/quantum-elixir to support it. Not so sure about the job :notify_about_scrum, cron: "30 9 * * 1-5" do
broadcast! :scrum, %{text: "Time for scrum!"}
end |> then after: {15, :minutes} do
broadcast! :reset, %{text: "relax! scrum's over"}
end We don't even have to provide an |
Oooo that's a cool syntax for it!
…On Wed, Jun 28, 2017 at 6:53 PM Dimitrios Zorbas ***@***.***> wrote:
We can support a cron-like interval format. We can even re-use some code
from https://github.com/c-rack/quantum-elixir to support it.
Not so sure about the for key though, seems to specific to the actual
use-case you have.
What about supporting a then macro?
job :notify_about_scrum, cron: "30 9 * * 1-5" do
broadcast! :scrum, %{text: "Time for scrum!"}end |> then after: {15, :minutes} do
broadcast! :reset, %{text: "relax! scrum's over"}end
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#115 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKs1TJNju2R35mr3H_my5cUJg8D3GAtks5sItl6gaJpZM4OD84H>
.
|
@davejlong I was thinking about this, implementing a
I also think it might be more straightforward to use https://github.com/c-rack/quantum-elixir # File: config/config.exs
config :your_app, Sample.Scheduler,
jobs: [{"30 9 * * 1-5", {ScheduledTasks, :opsgenie, []}}] defmodule ScheduledTasks do
import Kitto.Notifer, only: [broadcast!: 2]
def opsgenie do
broadcast! :opsgenie, %{alert: "Server is down"}
end
end It might be worth it writing a wiki guide about this, to provide a working solution first. |
Feature request for the ability to schedule jobs in a cron style schedule.
Example Use Case
Schedule to post a message in a Text widget every day:
The expected functionality would be that at 9:30 on Monday through Friday the message "Time for scrum!" would be broadcasted to the
:scrum
event. Thefor
key in the job setup would build a second job that would run 15 minutes later (9:45 Monday through Friday) that would clear the event from the cache allowing the text widget to go back to it's default value.The text was updated successfully, but these errors were encountered: