server/irc/connection.js
function processIrcLines(irc_con, continue_processing) {
    if (irc_con.reading_buffer && !continue_processing) return;
    irc_con.reading_buffer = true;

    var lines_per_js_tick = 4,
        processed_lines = 0;

    while(processed_lines < lines_per_js_tick && irc_con.read_buffer.length > 0) {
        parseIrcLine(irc_con, irc_con.read_buffer.shift());
        processed_lines++;
        Stats.incr('irc.connection.parsed_lines');
    }

    if (irc_con.read_buffer.length > 0) {
        irc_con.setTimeout(processIrcLines, 1, irc_con, true);
    } else {
        irc_con.reading_buffer = false;
    }
}
function processIrcLines(irc_con, continue_processing) {
    if (irc_con.reading_buffer && !continue_processing) return;
    irc_con.reading_buffer = true;

    var lines_per_js_tick = 4,
        processed_lines = 0;

    while(processed_lines < lines_per_js_tick && irc_con.read_buffer.length > 0) {
        parseIrcLine(irc_con, irc_con.read_buffer.shift());
        processed_lines++;
        Stats.incr('irc.connection.parsed_lines');
    }

    if (irc_con.read_buffer.length > 0) {
        irc_con.setTimeout(processIrcLines, 1, irc_con, true);
    } else {
        irc_con.reading_buffer = false;
    }
}
function processIrcLines ( irc_con , continue_processing ) { if ( irc_con . reading_buffer && ! continue_processing ) return ; irc_con . reading_buffer = true ; var lines_per_js_tick = 4 , processed_lines = 0 ; while ( processed_lines < lines_per_js_tick && irc_con . read_buffer . length > 0 ) { parseIrcLine ( irc_con , irc_con . read_buffer . shift ( ) ) ; processed_lines ++ ; Stats . incr ( 'irc.connection.parsed_lines' ) ; } if ( irc_con . read_buffer . length > 0 ) { irc_con . setTimeout ( processIrcLines , 1 , irc_con , true ) ; } else { irc_con . reading_buffer = false ; } }
Process the messages recieved from the IRCd that are buffered on an IrcConnection object
Will only process 4 lines per JS tick so that node can handle any other events while
handling a large buffer
Process the messages recieved from the IRCd that are buffered on an IrcConnection object Will only process 4 lines per JS tick so that node can handle any other events while handling a large buffer