lib/server/subscription.js
/**
 * extract up to maxNotificationsPerPublish notifications
 * @param monitoredItems
 * @param maxNotificationsPerPublish
 * @return {Array}
 */
extract up to maxNotificationsPerPublish notifications
@param monitoredItems
@param maxNotificationsPerPublish
@return {Array}
extract up to maxNotificationsPerPublish notifications @param monitoredItems @param maxNotificationsPerPublish @return { Array }
function extract_notifications_chunk(monitoredItems, maxNotificationsPerPublish) {
    var n = maxNotificationsPerPublish === 0 ?
        monitoredItems.length :
        Math.min(monitoredItems.length, maxNotificationsPerPublish);
    var chunk_monitoredItems = [];
    while (n) {
        chunk_monitoredItems.push(monitoredItems.shift());
        n--;
    }
    return chunk_monitoredItems;
}
function extract_notifications_chunk ( monitoredItems , maxNotificationsPerPublish ) { var n = maxNotificationsPerPublish === 0 ? monitoredItems . length : Math . min ( monitoredItems . length , maxNotificationsPerPublish ) ; var chunk_monitoredItems = [ ] ; while ( n ) { chunk_monitoredItems . push ( monitoredItems . shift ( ) ) ; n -- ; } return chunk_monitoredItems ; }
extract up to maxNotificationsPerPublish notifications
 @param monitoredItems
 @param maxNotificationsPerPublish
 @return {Array}
extract up to maxNotificationsPerPublish notifications @param monitoredItems @param maxNotificationsPerPublish @return { Array }