REST based message queue

November 22, 2009

I’ve been playing with lots of message queues lately, and with each of one, a protocol is favoured. There are modules for all protocols for a given MQ if you look further, but usually only one of them is more developed than others. That’s ok, because it’s hard to find willing people to help in open source projects.

Based on what I saw and used, a simple queue would suffice for most of cases. I tried Amazon SQS and the idea behind it is nice and simple. As I was looking to build a small “cloud-y” infra structure for my projects, I’ve started to build such queue using Google’s AppEngine. This was almost 1 year ago and just last week I found the original code, which immediatly I saw to clean, add API Keys and make it public.

Read the rest of this entry »

…or how to do proper caching without heavily modifing your code.

I’ve been using this technique on django views and Juno for some time. It’s just a decorator which inspect the parameters given to a function to search for a key on memcached.

You will find two files on github: no_decorator_example.py and decorator_example_memcache.py. Both of them search on twitter for a given term. The first script executes the search everytime, and the second script implements a 60 second cache, which uses the parameter (search term) as key.

I’m sure there must be another way to deal with parameters without the wrapper class, but so far nothing I’ve tried gave the same result.

ForĀ  Django views, one could go so far as using return HttpResponse(your_response, mimetype=’text_plain’) too.

Enjoy.