DBQueueManager.php

Summary
DBQueueManager.php
Database Queue ManagerSimple-minded queue manager for storing items in the database
DBQueueManager
enqueueSaves an object reference into the queue item table.
pollRun a polling cycle during idle processing in the input loop.
noHandlerFoundWhat to do if no handler was found.
_doneDelete our claimed item from the queue after successful processing.
_failFree our claimed queue item for later reprocessing in case of temporary failure.

Database Queue Manager

Simple-minded queue manager for storing items in the database

postActiv

the micro-blogging software

Copyright

Copyright © 2016-2017, 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

Simple-minded queue manager for storing items in the database

PHP version

Tested with PHP 7

File Authors

Web

DBQueueManager

Summary
enqueueSaves an object reference into the queue item table.
pollRun a polling cycle during idle processing in the input loop.
noHandlerFoundWhat to do if no handler was found.
_doneDelete our claimed item from the queue after successful processing.
_failFree our claimed queue item for later reprocessing in case of temporary failure.

enqueue

public function enqueue($object,
$queue)

Saves an object reference into the queue item table.

@return boolean true on success @throws ServerException on failure

poll

public function poll()

Run a polling cycle during idle processing in the input loop.  @return boolean true if we should poll again for more data immediately

noHandlerFound

protected function noHandlerFound(Queue_item $qi,  
 $rep = null)

What to do if no handler was found.  For example, the OpportunisticQM should avoid deleting items just because it can’t reach XMPP queues etc.

_done

protected function _done(Queue_item $qi)

Delete our claimed item from the queue after successful processing.

@param QueueItem $qi

_fail

protected function _fail(Queue_item $qi,  
 $releaseOnly = false)

Free our claimed queue item for later reprocessing in case of temporary failure.

@param QueueItem $qi

public function enqueue($object,
$queue)
Saves an object reference into the queue item table.
public function poll()
Run a polling cycle during idle processing in the input loop.
protected function noHandlerFound(Queue_item $qi,  
 $rep = null)
What to do if no handler was found.
protected function _done(Queue_item $qi)
Delete our claimed item from the queue after successful processing.
protected function _fail(Queue_item $qi,  
 $releaseOnly = false)
Free our claimed queue item for later reprocessing in case of temporary failure.