vsivsi / meteor-job-collection

A persistent and reactive job queue for Meteor, supporting distributed workers that can run anywhere.
https://atmospherejs.com/vsivsi/job-collection
Other
385 stars 68 forks source link

Run worker async and collect results in meteor #176

Closed marvin-bitterlich closed 8 years ago

marvin-bitterlich commented 8 years ago

I am currently trying to wrap my head around this:

I have a MongoDB collection of entitys on whom I have to run some updates every now and then. Once an update is triggered, I want to periodically do a bit of work, like so:

schedule job from meteor event
//delay 1 second
work on job for 5%
update MongoDB collection with progress and dispatch meteor events (as things have changed)
reschedule the job for 1 second
//repeat until 100%
complete job

Is there a way to run the worker async but inside the meteor process? Does your example app do exactly that and I missed something? What do I have to do to update meteor?

I want to schedule/run the job on the server and dispatch events to update the client once it's done. Since the queue is server-only I want to get something minimal and your examples are way to much stuff for my needs :)

Thanks for your help!

marvin-bitterlich commented 8 years ago

Seems like #172 with the code here https://github.com/keyscores/simplest_example_meteor_job_collection makes a good simple example. I'll try to modify this to run async