globocom/thumbor — pull request #220 by 198d (2013-11-12 22:53:00+00:00)
Title: Server Socket from File Desriptor

Update thumbor server to take a new option, -f/--fd, which expects a
file descriptor to create a socket from. This socket is then given to
the HTTPServer. This change makes it possible to run thumbor under
something like circus.

I'd like to run thumbor under circus (http://circus.readthedocs.org/en/latest/) and the best way to do that is to allow circus to manage your sockets for you and have your program open a socket based on a file descriptor that circus provides to you. This change makes that possible. A sample circus.ini that this works with would be:

```
[socket:thumbor]
port = 8888
host = 0.0.0.0

[watcher:thumbor]
cmd = .env/bin/thumbor --fd $(circus.sockets.thumbor)
use_sockets = True
```

Running thumbor this way also makes it much easier to run multiple instances since you don't have to worry about managing multiple ports.