Skip to content

Instantly share code, notes, and snippets.

View joshuathayer's full-sized avatar

Joshua Thayer joshuathayer

  • San Francisco, CA
View GitHub Profile
@joshuathayer
joshuathayer / gist:3868785
Created October 10, 2012 22:06 — forked from anonymous/gist:3868185
Queue Anti-patterns (an argument in DMs)
I can make a case that queues only do what people want if you don’t consider failure cases.
Qs are empty (normal) or full (fail). Normally things are processed quickly. Failure case processing time is unbounded (or “too long”).
Solution is always “dump the Q”. Which means you do care about how long it takes to process items. So you want the queue to always be empty
Which means you only want a non-failing Q.
So why not admit it, use in-proc buffers, run enough servers to handle load? Reject work up front instead of dropping oldest items w/…