/** * Queue up direct feed update pushes to subscribers on our internal hub. * @param string $atom update feed, containing only new/changed items * @param HubSub $sub open query of subscribers */ function pushFeedInternal($atom, $sub) { common_log(LOG_INFO, "Preparing {$sub->N} PuSH distribution(s) for {$sub->topic}"); while ($sub->fetch()) { $sub->distribute($atom); } }
/** * Queue up direct feed update pushes to subscribers on our internal hub. * If there are a large number of subscriber sites, intermediate bulk * distribution triggers may be queued. * * @param string $atom update feed, containing only new/changed items * @param HubSub $sub open query of subscribers */ function pushFeedInternal($atom, $sub) { common_log(LOG_INFO, "Preparing {$sub->N} PuSH distribution(s) for {$sub->topic}"); $n = 0; $batch = array(); while ($sub->fetch()) { $n++; if ($n < self::MAX_UNBATCHED) { $sub->distribute($atom); } else { $batch[] = $sub->callback; if (count($batch) >= self::BATCH_SIZE) { $sub->bulkDistribute($atom, $batch); $batch = array(); } } } if (count($batch) >= 0) { $sub->bulkDistribute($atom, $batch); } }