diff options
author | Brion Vibber <brion@pobox.com> | 2010-06-03 17:49:20 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-06-03 18:06:55 -0700 |
commit | 8b9436e8ae1ebcc7ef10752bb9666939200e26aa (patch) | |
tree | 7b4733d63875783d440c0927dd08a5a012e63549 /lib | |
parent | a75095fa1a3926d1fcc18c3d7285141fa3bef344 (diff) |
Option to divert PuSH items directly to the target site's queue when local
Diffstat (limited to 'lib')
-rw-r--r-- | lib/stompqueuemanager.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/stompqueuemanager.php b/lib/stompqueuemanager.php index de4ba7f01..91faa8c36 100644 --- a/lib/stompqueuemanager.php +++ b/lib/stompqueuemanager.php @@ -115,11 +115,12 @@ class StompQueueManager extends QueueManager * * @param mixed $object * @param string $queue + * @param string $siteNickname optional override to drop into another site's queue * * @return boolean true on success * @throws StompException on connection or send error */ - public function enqueue($object, $queue) + public function enqueue($object, $queue, $siteNickname=null) { $this->_connect(); if (common_config('queue', 'stomp_enqueue_on')) { @@ -134,7 +135,7 @@ class StompQueueManager extends QueueManager } else { $idx = $this->defaultIdx; } - return $this->_doEnqueue($object, $queue, $idx); + return $this->_doEnqueue($object, $queue, $idx, $siteNickname); } /** @@ -144,10 +145,10 @@ class StompQueueManager extends QueueManager * @return boolean true on success * @throws StompException on connection or send error */ - protected function _doEnqueue($object, $queue, $idx) + protected function _doEnqueue($object, $queue, $idx, $siteNickname=null) { $rep = $this->logrep($object); - $envelope = array('site' => common_config('site', 'nickname'), + $envelope = array('site' => $siteNickname ? $siteNickname : common_config('site', 'nickname'), 'handler' => $queue, 'payload' => $this->encode($object)); $msg = serialize($envelope); |