Best way to run processing heavy task inside of meteor

Tobias

Maybe weaverjs might help you.

http://weaver.js.org/

From their website:

Expensive calculations can make your app painfully slow for your users. You can make parallelisable code much faster by using Weaver.js, making your app snappier and your users happier.

And there’s even a Meteor package for it:

meteor add maxkfranz:weaver

Hope it helps!

1 Like

Continuing with theme of workers, for lack of understanding child processes or threads/event loops in node.js, you could basically run workers that conduct operations through controller that foremost looks at document that represents state. If you need work immidiately done you modify state document to point out that high priority work is available, with ddp you can observe changes in method to await results for document that should have necessary data on updated by worker. The params and stuff can go in CRON or state document, although I don’t know if the above mentioned worker package that depends on CRON can permit this sort of thing be it limitations of CRON (there’s another format for jobs) or how package operates.

arunoda/meteor-cluster this apparently makes workers within the same instance so you don’t have to use child processes, but it’s unstable.