Queuing Mechanism

Hi,

Wanted to know is there any queuing mechanism available for Meteor JS?
Here queue means is file-system persistence queue, not the in-memory queue.

Thanks.

There are many forms of queues, some are server based like kafka and it’s predecessor beanstalkd

For a file persistent queue - it is simply a file with a entry per line that can be written to and read - to be then accessed as an array by splitting on the new line character or carriage return e.g split('/r/n'); and parsing the line’s data.

So you can just write a file and add each queue entry to the file if you wish to do that so you have for example a file called something like pending.queue

For example with json data per line:

{'a key':'something that means something to your software here'}
{'another key':'something different that means something to your software.. eg do this or do that'}

You can then load this file and breakout the lines and then parse them if they were json like this and use them as objects or you could come up with your own idea entirely. Or you could just write the whole thing as json and parse it that way. Up to you. But before you do this read below… because this is a crappy design.

I’d favour using kafka or beanstalkd instead of re-inventing the wheel because what I have just described is a sub-optimal design that’s very rudimental and rigid as it doesn’t allocate for race conditions, multiple servers or really have any quality assurance at all. So it will be like starting from scratch, which although will be an educational journey for yourself, is not necessary and may waste time. If you are being paid to do this, use an existing queue and RTM (Read The Manual) and probably buy a O’reilys book so you are actually able to use it within the next few days.

Maybe this package can solve your needs - it persists to MongoDB

3 Likes

Nice name for this package

1 Like