1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- if (!defined('STATUSNET')) {
- exit(1);
- }
- class HubOutQueueHandler extends QueueHandler
- {
- function transport()
- {
- return 'hubout';
- }
- function handle($data)
- {
- $sub = $data['sub'];
- $atom = $data['atom'];
- $retries = $data['retries'];
- assert($sub instanceof HubSub);
- assert(is_string($atom));
- try {
- $sub->push($atom);
- } catch (Exception $e) {
- $retries--;
- $msg = "Failed PuSH to $sub->callback for $sub->topic: " .
- $e->getMessage();
- if ($retries > 0) {
- common_log(LOG_ERR, "$msg; scheduling for $retries more tries");
-
-
- $sub->distribute($atom, $retries);
- } else {
- common_log(LOG_ERR, "$msg; discarding");
- }
- }
- return true;
- }
- }
|