Skip to content
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 Trigger #7

Open
scls19fr opened this issue Jan 18, 2018 · 0 comments
Open

Cron Trigger #7

scls19fr opened this issue Jan 18, 2018 · 0 comments

Comments

@scls19fr
Copy link
Owner

scls19fr commented Jan 18, 2018

A trigger which support cron syntax could be a nice feature to have

Usage:

sched = BlockingScheduler()

# Define what action will be executed
action = Action(print_time_kwargs; Dict(:a=>"keyword")...)

# Define when job should be triggered
trigger = Trigger(Cron("45 23 * * 6"))  # execute according a cron syntax (at 23:45 (11:45 PM) every Saturday. in this specific case)
# or
# trigger = CronTrigger("45 23 * * 6")

add(sched, action, trigger)

# Run scheduler
run(sched)

Maybe a standalone package only responsible of parsing a cron syntax could be created and ExtensibleScheduler could depend on such a package if it provides a stable API.
See CronParser.jl

tonext(Cron("45 23 * * 6"), DateTime(2018,1,18,0,0)))

should return for example DateTime(2018,1,20,23,45)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant