var curReq = null;
var requests = [];

function nextRequest() {
    if(curReq = requests.shift()) {
        request(
            curReq[0],
            function(x) { curReq[1](x); nextRequest(); },
            curReq[2]
        );
    }
}

function doRequest(url, callback, args) {
    requests.push(arguments);
    if(curReq == null)
        nextRequest();
}