Skip to content

Instantly share code, notes, and snippets.

View jdthorpe's full-sized avatar
💭
Can we all just agree it's pronounced "kubernetes"

Jason Thorpe jdthorpe

💭
Can we all just agree it's pronounced "kubernetes"
View GitHub Profile
@jdthorpe
jdthorpe / README.md
Created December 16, 2016 13:38 — forked from dolphin278/README.md
Pub/sub example for nodejs using mongodb

Uses capped collection, tailable cursors and streams.

What's here?

  • init.js recreates collection capped collection 'queue' on mongodb.
  • writer.js spams queue with new messages
  • worker.js processes all messages saved to queue,
  • onceWorker.js processes only unprocessed messages, so you can spawn several of them and each of your messages will be processed by only one worker.

Steps