kurokikaze/limestone — pull request #18 by JoeZ99 (2011-11-22 03:20:01+00:00)
Title: Added queuing capability 

Now when a call to the "query" or "callback" method is made, instead of querying the sphinx server right away, limestone puts them on a queue.

- when adding to the queue:
- if queue.length is 1 then run the command immediately (the first query you add always comply with this)
- when removing from the queue:
- if there are still elements in the query, run the first

this way, commands are always run in order, and now you can call the "query" and "build_excerpts" methods outside the scope of the callback function (see README).

I'm very sorry about the huge red and green zones. I had the great idea of reindenting everything! please accept my apologies.

short summary of the important changes:
queuing/dequeuing:
L345, L432, L439, L458, L537
custom event in case the connection is not yet done when queueing:
L144