Wednesday, March 18, 2009

Sending files from ruby without blocking

Sometimes you need to provide some processing before sending large files. i.e To verify the user is logged in or has paid for the resource.

The problem with sending large files from Rails, is that the process can block until the file has completed. This knocks out one of your processes that could be dealing with requests.

Fortunately you can use X-Sendfile, which offloads the work to apache to handle and your process will continue working. You just say what file you want to send and it returns. There's an apache module that does all the hard work.

Here's a more thorough explanation.

Wednesday, March 04, 2009

Pics of Robots

I'm still patiently waiting for my own robot..

I'm amazed on how well they seem to keep their balance.
Here's some pictures that make me think the day is coming closer.

Hmm.. maybe we need to seriously start thinking about the Three-Laws-of-Robotics?