DistribQueueHandler.php

Summary
DistribQueueHandler.php
DistribQueueHandlerTransport that handles federation of notices.
transportReturn transport keyword which identifies items this queue handler services; must be defined for all subclasses.
handle
logitLog an exception we come across in handling federation

DistribQueueHandler

Transport that handles federation of notices.

postActiv

the micro-blogging software

Copyright

Copyright © 2016, Maiyannah Bishop

Derived from code copyright various sources

  • GNU Social © 2013-2016, Free Software Foundation, Inc
  • StatusNet © 2008-2012, StatusNet, Inc

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program.  If not, see http://www.gnu.org/licenses/.

https://www.gnu.org/licenses/agpl.html

About

As extensions of the Daemon class, each queue handler has the ability to launch itself in the background, at which point it’ll pass control to the configured QueueManager class to poll for updates.

Subclasses must override at least the following methods

  • transport
  • handle_notice

PHP version

Tested with PHP 5.6

File Authors

Web

Summary
transportReturn transport keyword which identifies items this queue handler services; must be defined for all subclasses.
handle
logitLog an exception we come across in handling federation

transport

public function transport()

Return transport keyword which identifies items this queue handler services; must be defined for all subclasses.

Must be 8 characters or less to fit in the queue_item database. ex “email”, “jabber”, “sms”, “irc”, ...

@return string

handle

public function handle(Notice $notice)

Handle distribution of a notice after we’ve saved it

  • add to local recipient inboxes
  • send email notifications to local @-reply targets
  • run final EndNoticeSave plugin events
  • put any remaining post-processing into the queues

If this function indicates failure, a warning will be logged and the item is placed back in the queue to be re-run.

Parameters

  • Notice $notice

Returns

  • boolean - true on success, false on failure

logit

protected function logit($notice,
$e)

Log an exception we come across in handling federation

public function transport()
Return transport keyword which identifies items this queue handler services; must be defined for all subclasses.
public function handle(Notice $notice)
protected function logit($notice,
$e)
Log an exception we come across in handling federation