server/kiwi.js
function (list) {
            var batch_size = 100,
                cutoff;

            if (list.length >= batch_size) {
                // If we have more clients than our batch size, call ourself with the next batch
                setTimeout(function () {
                    sendCommandBatch(list.slice(batch_size));
                }, 200);

                cutoff = batch_size;

            } else {
                cutoff = list.length;
            }

            list.slice(0, cutoff).forEach(function (client) {
                if (!client.disposed) {
                    client.sendKiwiCommand(command, data);
                }
            });

            if (cutoff === list.length && typeof callback === 'function') {
                callback();
            }
        }
function (list) {
            var batch_size = 100,
                cutoff;

            if (list.length >= batch_size) {
                // If we have more clients than our batch size, call ourself with the next batch
                setTimeout(function () {
                    sendCommandBatch(list.slice(batch_size));
                }, 200);

                cutoff = batch_size;

            } else {
                cutoff = list.length;
            }

            list.slice(0, cutoff).forEach(function (client) {
                if (!client.disposed) {
                    client.sendKiwiCommand(command, data);
                }
            });

            if (cutoff === list.length && typeof callback === 'function') {
                callback();
            }
        }
function ( list ) { var batch_size = 100 , cutoff ; if ( list . length >= batch_size ) { // If we have more clients than our batch size, call ourself with the next batch setTimeout ( function ( ) { sendCommandBatch ( list . slice ( batch_size ) ) ; } , 200 ) ; cutoff = batch_size ; } else { cutoff = list . length ; } list . slice ( 0 , cutoff ) . forEach ( function ( client ) { if ( ! client . disposed ) { client . sendKiwiCommand ( command , data ) ; } } ) ; if ( cutoff === list . length && typeof callback === 'function' ) { callback ( ) ; } }
Sending of the command in batches
Sending of the command in batches