vapor / queues

A queue system for Vapor.
MIT License
169 stars 41 forks source link

Add Scheduler #14

Closed jdmcd closed 5 years ago

jdmcd commented 5 years ago

This is part 1 of ? breaking up the work done by @rnantes to make it a tad easier to review. This PR adds two main ideas:

  1. A Scheduler object that defines the public method for scheduling a job
  2. A ScheduledJob type that provides a protocol for representing functionality that can be scheduled.

Parts to come in future versions:

  1. RecurrenceRule which does all of the calculations for the dates
  2. A new Command that will run the scheduled jobs.

Todo for this PR:

Example Usage:

try config.schedule(DailyCleanupJob()).daily().at(.startOfDay)
jdmcd commented 5 years ago

@tanner0101 Updated with the changes I could make, lmk what progress you're able to make with refactoring Scheduler

jdmcd commented 5 years ago

Closing in favor of #15