node/docfetcher.js
// awaiting. If needed fetch from next or unavailable if last
awaiting. If needed fetch from next or unavailable if last
awaiting . If needed fetch from next or unavailable if last
function disconnect(connection_id){
    for(hash in this.docs_being_fetched){
        var pos = this.docs_being_fetched[hash].providers.indexOf(connection_id);
        if(pos >= 0)
            this.docs_being_fetched[hash].providers.splice(pos, 1);
        var pos2 = this.docs_being_fetched[hash].awaiting.indexOf(connection_id);
        if(pos2 >= 0)
            this.docs_being_fetched[hash].awaiting.splice(pos2, 1);
        if(pos == 0){
            if(this.docs_being_fetched[hash].length == 0){
                this.unavailable(hash);
            }else{
                this.fetch_top(hash);
            }
        }
    }
}
function disconnect ( connection_id ) { for ( hash in this . docs_being_fetched ) { var pos = this . docs_being_fetched [ hash ] . providers . indexOf ( connection_id ) ; if ( pos >= 0 ) this . docs_being_fetched [ hash ] . providers . splice ( pos , 1 ) ; var pos2 = this . docs_being_fetched [ hash ] . awaiting . indexOf ( connection_id ) ; if ( pos2 >= 0 ) this . docs_being_fetched [ hash ] . awaiting . splice ( pos2 , 1 ) ; if ( pos == 0 ) { if ( this . docs_being_fetched [ hash ] . length == 0 ) { this . unavailable ( hash ) ; } else { this . fetch_top ( hash ) ; } } } }
awaiting.
awaiting .