Giter VIP home page Giter VIP logo

schedule-drone's People

Contributors

jvrbaena avatar topliceanu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

schedule-drone's Issues

scheduleAndStore Saves the data but doesn't schedule CRON

I am playing with your cron module. I've noticed the scheduleAndStore saves the data in the database but it doesn't fire event. I don't know coffeescript but I think may be adding schedule(dataOrCronString, eventName, eventPayload) method on line 68 should resolve the issue.
eg.
store.save data, (err, storedEvent) =>
if err callback err
schedule '* * * * * 1', 'my-cron-event', params

Following is the javascript equivalent.

return store.save(data, function(err, storedEvent) {
if(err) return callback(err);
PersistentScheduler.super.schedule(timestamp, event, payload);
return callback(null, storedEvent);
});

scheduler.scheduleAndStore not working as expected

scheduleAndStore saves the cron-job in database but it doesn't get active immediate after it's registration. Let have a scenario an user on a live project registered a cron job by hitting an api. It should be active immediate but not working as expected.

`var url = "mongodb://localhost:27017/my-test-db";
drone.setConfig(
{
persistence: {
type: 'mongodb',
connectionString: url,
eventsCollection: 'schedular',
options: {}
}
}
);

scheduler = drone.daemon();
try {
setTimeout(() => {
scheduler.scheduleAndStore('* * * * * * ', 'my-job', {
task: 'sendReport', campaignId: 'abc'
}, function () {
console.log('job registered');
});
}, 3000);
} catch (Exception) {
console.log('Exception', Exception);
}

scheduler.on('my-job', function (params) {
if (params.task == 'sendReport') {
// send campaign email
// sendEmailCampaign(params.campaignId);
}
});`

roadmap to v1

  • organize the module into two distinct pieces:
    • scheduler process
    • rest api process for publishing scheduled tasks, use mortimer
  • get inspiration from other projects:
  • add comments, generated docs, code coverage, examples, etc.https://mandrillapp.com/api/docs/webhooks.html)
  • simplify current implementation, no need to extend event emitter
  • support full configuration of webhooks, alternate urls, fallback urls, monitoring, etc.
  • allow customization of endpoint requests. This should allow people to post on queues, etc. Support Amazon SQS and Azure Storage Queue. Support HTTP Basic Auth for outbount links
  • [nice to have] make it api-compatible with azure scheduler
  • maintain a job history, store the results for all the executed jobs
  • [nice to have] add a ui for the scheduler-drone in angular.js
  • find a way to bundle recurring jobs toghether, so they don't appear as being separated from each other
  • syntax for a scheduler job, what it contains and how it translates to work docs: retry policy, http verb&url, what to do when there is an error, recurrance params, time of day, job state, outbound endpoint response, etc.
  • cli interface for the daemon process
  • documentation on the azure scheduler http://msdn.microsoft.com/en-us/library/azure/dn479785.aspx
  • you could have a recurrent request be performed with a certain periodicity, but not after a configured date.
  • human readable cron intervals
  • option to specify timezone when configuring a job!

Old and busted todos

  • use redis as a backend and especially it's EXPIRE NOTIFY feature
  • rest api and programatic api (only when embedded in node.js applications)
  • complete refactor, rewrite everything in coffeescript, use express.js for rest api, use mocha for testing

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.