whisper1/esque — pull request #3 by dsabanin (2014-05-22 18:15:48+00:00)
Title: Optional JSON serialization/deserialization for the jobs.

Added optional JSON serialization support. Allows receiving and sending jobs from non-Erlang/Elixir languages. JSX library is used for JSON (the least dependencies and seems mature).

You can specify format when you post a job into queue with:

```erlang
esque:queue([{name,"myqueue"}, {format, json}], [arg1, arg2]).
```

Or you can specify for all jobs to be sent in a specific format through **format** env variable in the application config file (**erlang** by default):

```erlang
{esque, [{format, json}]}
```

Formats are called: **json** and **erlang** (for erlang's binary format).

Format of incoming jobs is autodetected through jsx:is_json/1 function and then either parsed as json or as erlang binary term format.

Please let me know if the code is fine or if you think it needs to be done differently. I'll be glad to make any changes.

I'm investigating integration of Erlang into a big multi-language infrastructure that uses quite a bit of resque (I know, sad). We need to be able to send and receive jobs in a way that is supported by all the clients and for that JSON support is required.