Facebooker Queue: Facebook API queues with Beanstalkd

May 23, 2009 - 0 Comments - ruby rails tools facebooker queue facebooker facebook

I’ve been working on a Rails-based Facebook app using the excellent Facebooker library, and the need became apparent for a background queueing service for calls to Facebook’s REST API.

I had already decided to go with Beanstalkd as a messaging queue for its fast, in-memory modus operandi, because this particular app makes API calls at a frequency comparable to the birthrate in China. Well, maybe not, but the potential is certainly there. I am also already using Beanstalkd in this project for purposes unrelated to the Facebook API, so I am married to it at this point.

There is currently a plugin called FacebookerMQ which uses its own custom database-backed queue. Since I had already decided on Beanstalkd and needed an in-memory queue, FacebookerMQ wouldn’t work for me. Also, I figured I could take things a step or two further.

So, without further ado, I am announcing Facebooker Queue (very clever name, I know). Not only does Facebooker Queue provide easy, transparent, drop-in API queueing for Facebooker, but it uses the Adapter pattern to provide agnosticism toward which queueing service you want to use, and it allows you to override queueing of any API call so that you can use the normal, synchronous behavior of Facebooker if at any time you need it.

Obviously, it comes with baked-in support for Beanstalkd, but the adapter interface is ridiculously simple, so you can feel free to use any messaging queue you choose.

Groundbreaking. Extraordinary. Well, not really, but definitely pretty cool.

Git it here.

Disclaimer: I developed this plugin during the after-hours of the last few nights (with the exception of last night, which I spent at a live performance by Nine Inch Nails and Jane’s Addiction). It has not seen production use just yet, but has worked beautifully for me in my development environment. Use at your own risk, and if you find anything that is lacking, do not hesitate to submit a patch or alert me to the issue.

I hope this is useful to other Facebook app developers out there who are also using Rails. Enjoy!

Comments

The Web is collaborative. Isn't it great?

Say Your Peace

Textile is allowed. Be polite. Be rude. I don't really give a fuck.

Your email will be kept safe and will never be publicly displayed.

 

Wha...?

11611e595f8866809b075a8e718e7600

Chris Vincent is a 20-something drummer, producer, and engineer from the Bay Area. This is where he writes whatever the hell he wants whenever the hell he wants to write it. Check your expectations at the home page.

Available for hire!

Looking for a top-notch Rubyist for contract? Check my resumé and drop me a line!

Obligatory tag cloud

me san francisco bicycling ruby tdd css tools iphone games rails facebooker queue facebooker facebook arduino activerecord sql css tools development process company culture spam akismet bluepill god

Recent posts

Feed me

Atom is cool.

Get in touch

Questions, comments, ideas?
Let's talk.

Unabashed self-promotion

Recommend Me