summaryrefslogtreecommitdiff
path: root/plugins/OStatus/classes/HubSub.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-06-04 11:48:54 -0700
committerBrion Vibber <brion@pobox.com>2010-06-07 10:03:43 -0700
commit41e9dba7297d43b7de0cb7665901869910d1047a (patch)
tree9da94d76ced9915be3e94065b66f19f33d5187e3 /plugins/OStatus/classes/HubSub.php
parent8b9436e8ae1ebcc7ef10752bb9666939200e26aa (diff)
OStatus plugin: Rolling batch queueing for PuSH output to >50 subscribing sites. Keeps latency down for other things enqueued while we work...
Diffstat (limited to 'plugins/OStatus/classes/HubSub.php')
-rw-r--r--plugins/OStatus/classes/HubSub.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/plugins/OStatus/classes/HubSub.php b/plugins/OStatus/classes/HubSub.php
index 9748b4a56..7db528a4e 100644
--- a/plugins/OStatus/classes/HubSub.php
+++ b/plugins/OStatus/classes/HubSub.php
@@ -305,6 +305,26 @@ class HubSub extends Memcached_DataObject
}
/**
+ * Queue up a large batch of pushes to multiple subscribers
+ * for this same topic update.
+ *
+ * If queues are disabled, this will run immediately.
+ *
+ * @param string $atom well-formed Atom feed
+ * @param array $pushCallbacks list of callback URLs
+ */
+ function bulkDistribute($atom, $pushCallbacks)
+ {
+ $data = array('atom' => $atom,
+ 'topic' => $this->topic,
+ 'pushCallbacks' => $pushCallbacks);
+ common_log(LOG_INFO, "Queuing PuSH batch: $this->topic to " .
+ count($pushCallbacks) . " sites");
+ $qm = QueueManager::get();
+ $qm->enqueue($data, 'hubprep');
+ }
+
+ /**
* Send a 'fat ping' to the subscriber's callback endpoint
* containing the given Atom feed chunk.
*