Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

I'm wondering, is there is way to implement background taks, maybe with workers pool. Can you show me direction, i'm thinking about writing package for this?

share|improve this question
up vote 86 down vote accepted

There are several packages to run background tasks in Meteor. From the simplest to the most involved:

Packages I would recommend caution with:

Avoid:

  • Kue - the priority job queue for Node.js backed by redis. Not updated for Meteor 0.9+.
  • cron (warning: very old)
share|improve this answer
1  
This one looks pretty popular: atmospherejs.com/percolatestudio/synced-cron – Adam Monsen Oct 8 '14 at 4:47
1  
This is a phenomenal list, thanks for keeping it up to date, a real service. – chmac Nov 27 '14 at 21:11
1  
@chmac: Thanks. I do keep lists like that. – Dan Dascalescu Nov 27 '14 at 21:16
2  
This package seams interesting: atmospherejs.com/differential/workers I didn't try it yet but I wanted to mention it to increase the options list – Humber Jan 11 '15 at 12:27
1  
@DanDascalescu I'm yet to do a full write-up on this one - but you can use celeryproject.org (Distributed task queue built on Python & RabbitMQ) - there's a meteor package we're currently using - atmospherejs.com/3stack/celery (See also atmospherejs.com/3stack/celery-connect for an easier setup) – nathan-m Jan 30 '15 at 1:00

There is a package based on Cron jobs which can be used to schedule tasks on certain intervals or dates. Here is the package: https://atmosphere.meteor.com/package/cron

And if you happen to look into the source of that package, you'll notice they're simply using:

Meteor.setInterval( ... , delay );

So if you save your tasks in a database, then load them into intervals during startup, then you'll probably be on the right track.

share|improve this answer
    
And there is a good possibility that those calls in the cron package can and should be changed to Meteor.setTimeout() calls. – Rob_vH May 8 '15 at 13:15

I'm guessing proper support is on their roadmap, but in the meantime I've managed to get it going in a hacky way via setInterval. See the cron-tick package.

share|improve this answer
    
@dan: great, link works now! – konrad Jan 25 '14 at 16:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.