unbit/uwsgi — pull request #328 by anaconda (2013-06-25 22:13:00+00:00)
Title: [Python] Added option to pass arguments to spooled function

Adds an optional `pass_arguments` parameter to spool* decorators.

Let's say you have a heavily used function or method. If you want it to be executed by the spooler, you have to:
a) change all calls, the spooler dictionary only accepts strings;
b) change the code of the function/method to read its parameters from a dictionary and convert them from str.

With this commit you just need to decorate the function with `@spool(pass_arguments=True)` and it'll get its arguments as before.

I had to rename the decorators' classes by adding a `_` and reimplement them as functions, otherwise `@spool` would've been become `@spool()`, breaking backward compatibility.