Commit b6a0536f by Maiyannah Bishop

Catching some stragglers to move to /classes/queue/

1 parent 13809829
<?php
/***
* postActiv - a fork of the GNU Social microblogging software
* Copyright (C) 2016, Maiyannah Bishop
* Derived from code copyright various sources:
* GNU Social (C) 2013-2016, Free Software Foundation, Inc
* StatusNet (C) 2008-2011, StatusNet, Inc
/* ============================================================================
* Title: IM Queue Manager
* Simple-minded queue manager for storing items from IMs
*
* PHP version 5
* postActiv:
* the micro-blogging software
*
* Copyright:
* Copyright (C) 2016, Maiyannah Bishop
*
* Derived from code copyright various sources:
* o GNU Social (C) 2013-2016, Free Software Foundation, Inc
* o StatusNet (C) 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
......@@ -21,12 +27,9 @@
* 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/>.
*
* @license https://www.gnu.org/licenses/agpl.html
*/
if (!defined('POSTACTIV')) { exit(1); }
/**
* <https://www.gnu.org/licenses/agpl.html>
* ----------------------------------------------------------------------------
* About:
* IKM background connection manager for IM-using queue handlers,
* allowing them to send outgoing messages on the right connection.
*
......@@ -40,25 +43,64 @@ if (!defined('POSTACTIV')) { exit(1); }
* 3) override idle($timeout) to do keepalives (if necessary)
* 4) implement send_raw_message() to send raw data that ImPlugin::enqueueOutgoingRaw
* enqueued
*
* PHP version:
* Tested with PHP 5.6
* ----------------------------------------------------------------------------
* File Authors:
* o Craig Andrews <candrews@integralblue.com>
* o Maiyannah Bishop <maiyannah.bishop@postactiv.com>
*
* Web:
* o postActiv <http://www.postactiv.com>
* o GNU social <https://www.gnu.org/s/social/>
* ============================================================================
*/
// This file is formatted so that it provides useful documentation output in
// NaturalDocs. Please be considerate of this before changing formatting.
if (!defined('POSTACTIV')) { exit(1); }
// ----------------------------------------------------------------------------
// Class: ImManager
// IKM background connection manager for IM-using queue handlers,
// allowing them to send outgoing messages on the right connection.
//
// In a multi-site queuedaemon.php run, one connection will be instantiated
// for each site being handled by the current process that has IM enabled.
//
// Implementations that extend this class will likely want to:
// 1) override start() with their connection process.
// 2) override handleInput() with what to do when data is waiting on
// one of the sockets
// 3) override idle($timeout) to do keepalives (if necessary)
// 4) implement send_raw_message() to send raw data that ImPlugin::enqueueOutgoingRaw
// enqueued
abstract class ImManager extends IoManager
{
abstract function send_raw_message($data);
// -------------------------------------------------------------------------
// Function: send_raw_message
abstract function send_raw_message($data);
function __construct($imPlugin)
{
$this->plugin = $imPlugin;
$this->plugin->imManager = $this;
}
// -------------------------------------------------------------------------
// Function: __construct
function __construct($imPlugin)
{
$this->plugin = $imPlugin;
$this->plugin->imManager = $this;
}
/**
* Fetch the singleton manager for the current site.
* @return mixed ImManager, or false if unneeded
*/
public static function get()
{
throw new Exception('ImManager should be created using it\'s constructor, not the static get method');
}
// -------------------------------------------------------------------------
// Function: get
// Fetch the singleton manager for the current site.
// @return mixed ImManager, or false if unneeded
public static function get() {
throw new Exception('ImManager should be created using it\'s constructor, not the static get method');
}
}
// END OF FILE
// ============================================================================
?>
\ No newline at end of file
<?php
/* <?php
/* ============================================================================
* Title: Stomp Queue Manager
* Queue manager class for the STOMP-based queue.
......@@ -50,7 +50,7 @@
*/
// This file is formatted so that it provides useful documentation output in
// NaturalDocs. Please be considerate of this before changing formatting.
// NaturalDocs. Please be considerate of this before changing formatting. */
require_once 'Stomp.php';
require_once 'Stomp/Exception.php';
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!