Skip to content

Instantly share code, notes, and snippets.

@intabulas
Last active January 22, 2016 23:23
Show Gist options
  • Save intabulas/28c055283103f37401cf to your computer and use it in GitHub Desktop.
Save intabulas/28c055283103f37401cf to your computer and use it in GitHub Desktop.
Rethinking Tasks
  • Issue: keithwhor/nodal#75

  • Branch: https://github.com/intabulas/nodal/tree/0_6_0-RefactorTasks

  • ✅ Right now we have ScheduledTask and Task with ScheduledTask being different in name only. I propose we drop ScheduledTask and just have Nodal.Task that can be scheduled or run one off

  • ✅ Add flags to nodal new g:task to take optional schedule information

  • ✅ Flag could be like nodal new g:task --schedule:5m. Maybe support s, m, h, d and w for durations. This would add to ./schedulers/main.js`

  • ✅ Add (like with router) /* generator: begin tasks */ and * generator: end tasks */ to ./schedulers/main.js so that we can automatically add them when g:task is run with scheduler info

  • ✅ Add (commented out) the default generated scheduler to app/app.js so that someone can quickly uncomment it to get scheduled tasks in the app thread

  • ✅ Add a flag to nodal new to uncomment the commented out scheduler in app/app.js like we do with database now

  • ❌ Add support for tasks to be bundled in npm modules for use by apps.. Need to think about how we "load" these

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment