A very basic queue to allow downloading feeds #24
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To get us started, I've taken a crack at writing a basic queue-based producer/consumer app, based on Bull (Bull on GitHub). Nothing in this PR is sacred, and it can all be changed, but I wanted to get us moving forward with a basic prototype people can hack on.
To run this, you need to have Redis installed (we'll need install docs added for Windows/Linux/macOS in other bugs and/or use Docker or something).
Next, you can start the server like so:
This will start the server, read the list of feed URLs in feeds.txt (just a few to get us something to test on), and convert them into jobs for the queue.
A worker will start watching for jobs to appear in the queue, and process them. At this point, all it does is download the feed from the URL and dump it to the console:
Once it processes all the jobs, it will sit and wait for more to arrive. Right now, none will, but we can restart the list after it completes.
Hopefully this will give people something to play with, and get you thinking about how to plug other things into the mix.
I'd like to merge this, but would appreciate a review before I do. Anyone able to do that for me?