[CORE] Better queues defaults

This commit is contained in:
Diogo Cordeiro 2019-12-11 02:20:54 +00:00 committed by Diogo Peralta Cordeiro
parent 351e356bb4
commit 91869c78ac
12 changed files with 68 additions and 61 deletions

View File

@ -228,7 +228,7 @@ sending out SMS email or XMPP messages, for off-line processing. See
* `enabled` (boolean, default false): Whether to uses queues. * `enabled` (boolean, default false): Whether to uses queues.
* `daemon` (boolean, default false): Wather to use queuedaemon. False means * `daemon` (boolean, default false): Whether to use queuedaemon. False means
you'll use OpportunisticQM plugin. you'll use OpportunisticQM plugin.
* `subsystem` (enum["db", "stomp"], default 'db'): Which kind of queueserver to * `subsystem` (enum["db", "stomp"], default 'db'): Which kind of queueserver to

View File

@ -356,6 +356,7 @@ $default =
'LRDD' => [], 'LRDD' => [],
'Nodeinfo' => [], 'Nodeinfo' => [],
'OpenID' => [], 'OpenID' => [],
'DBQueue' => [],
'OpportunisticQM' => [], 'OpportunisticQM' => [],
'RemoteFollow' => [], 'RemoteFollow' => [],
'ActivityPub' => [], // The order is important here (IT HAS TO COME BEFORE OSTATUS) 'ActivityPub' => [], // The order is important here (IT HAS TO COME BEFORE OSTATUS)
@ -363,7 +364,6 @@ $default =
'Poll' => [], 'Poll' => [],
'SimpleCaptcha' => [], 'SimpleCaptcha' => [],
'TagSub' => [], 'TagSub' => [],
'UnQueue' => [],
'WebFinger' => [], 'WebFinger' => [],
], ],
'locale_path' => false, // Set to a path to use *instead of* each plugin's own locale subdirectories 'locale_path' => false, // Set to a path to use *instead of* each plugin's own locale subdirectories

View File

@ -27,7 +27,7 @@ defined('GNUSOCIAL') || die();
class DBQueuePlugin extends Plugin class DBQueuePlugin extends Plugin
{ {
const PLUGIN_VERSION = '0.0.1'; const PLUGIN_VERSION = '0.1.0';
public function onStartNewQueueManager(?QueueManager &$qm) public function onStartNewQueueManager(?QueueManager &$qm)
{ {
@ -38,12 +38,15 @@ class DBQueuePlugin extends Plugin
public function onPluginVersion(array &$versions): bool public function onPluginVersion(array &$versions): bool
{ {
$versions[] = array('name' => 'DBQueue', $versions[] = [
'version' => self::PLUGIN_VERSION, 'name' => 'DBQueue',
'author' => 'Miguel Dantas', 'version' => self::PLUGIN_VERSION,
'description' => 'author' => 'Miguel Dantas',
// TRANS: Plugin description. 'homepage' => GNUSOCIAL_ENGINE_URL,
_m('Plugin using the database as a backend for GNU social queues')); 'description' =>
// TRANS: Plugin description.
_m('Plugin using the database as a backend for GNU social queues')
];
return true; return true;
} }
}; };

View File

@ -4,9 +4,7 @@ that uses the database as it's backing storage.
Installation Installation
============ ============
This plugin is replaces other queue manager plugins, such as UnQueue, This plugin is enabled by default and replaces other queue manager plugins, such as UnQueue.
which enabled by default and which should, but is not required to be
disabled.
addPlugin('DBQueue'); addPlugin('DBQueue');
@ -15,4 +13,4 @@ Example
In config.php In config.php
addPlugin('DBQueue'); addPlugin('DBQueue');

View File

@ -34,7 +34,7 @@ use Predis\PredisException;
class RedisCachePlugin extends Plugin class RedisCachePlugin extends Plugin
{ {
const PLUGIN_VERSION = '0.0.1'; const PLUGIN_VERSION = '0.1.0';
// settings which can be set in config.php with addPlugin('Embed', ['param'=>'value', ...]); // settings which can be set in config.php with addPlugin('Embed', ['param'=>'value', ...]);
public $server = null; public $server = null;
@ -133,13 +133,15 @@ class RedisCachePlugin extends Plugin
public function onPluginVersion(array &$versions): bool public function onPluginVersion(array &$versions): bool
{ {
$versions[] = array('name' => 'RedisCache', $versions[] = [
'version' => self::VERSION, 'name' => 'RedisCache',
'author' => 'chimo', 'version' => self::VERSION,
'homepage' => 'https://github.com/chimo/gs-rediscache', 'author' => 'Stéphane Bérubé (chimo)',
'description' => 'homepage' => 'https://github.com/chimo/gs-rediscache',
// TRANS: Plugin description. 'description' =>
_m('Plugin implementing Redis as a backend for GNU social caching')); // TRANS: Plugin description.
_m('Plugin implementing Redis as a backend for GNU social caching')
];
return true; return true;
} }
} }

View File

@ -4,9 +4,9 @@ that uses Redis as it's backing storage.
Installation Installation
============ ============
This plugin is replaces other queue manager plugins, such as UnQueue, This plugin replaces other queue manager plugins, such as UnQueue and DBQueue.
which enabled by default and which should, but is not required to be You don't have to disable them but it is recommended to only use a QueueManager
disabled. at a time.
addPlugin('RedisQueue', ['server' => 'your-redis-instance-and-port']); addPlugin('RedisQueue', ['server' => 'your-redis-instance-and-port']);
@ -15,4 +15,4 @@ Example
In config.php In config.php
addPlugin('RedisQueue', ['server' => 'tcp://localhost:6379']); addPlugin('RedisQueue', ['server' => 'tcp://localhost:6379']);

View File

@ -27,7 +27,7 @@ defined('GNUSOCIAL') || die();
class RedisQueuePlugin extends Plugin class RedisQueuePlugin extends Plugin
{ {
const PLUGIN_VERSION = '0.0.1'; const PLUGIN_VERSION = '0.1.0';
// settings which can be set in config.php with addPlugin('RedisQueue', ['param'=>'value', ...]); // settings which can be set in config.php with addPlugin('RedisQueue', ['param'=>'value', ...]);
public $server = null; public $server = null;
@ -40,12 +40,15 @@ class RedisQueuePlugin extends Plugin
public function onPluginVersion(array &$versions): bool public function onPluginVersion(array &$versions): bool
{ {
$versions[] = array('name' => 'RedisQueue', $versions[] = [
'version' => self::PLUGIN_VERSION, 'name' => 'RedisQueue',
'author' => 'Miguel Dantas', 'version' => self::PLUGIN_VERSION,
'description' => 'author' => 'Miguel Dantas',
// TRANS: Plugin description. 'homepage' => GNUSOCIAL_ENGINE_URL,
_m('Plugin implementing Redis as a backend for GNU social queues')); 'description' =>
// TRANS: Plugin description.
_m('Plugin implementing Redis as a backend for GNU social queues')
];
return true; return true;
} }
}; };

View File

@ -8,7 +8,7 @@ This plugin is replaces other queue manager plugins, such as UnQueue,
which enabled by default and which should, but is not required to be which enabled by default and which should, but is not required to be
disabled. disabled.
addPlugin('StompQueue', ['servers' => ['your-redis-instance-and-port'], addPlugin('StompQueue', ['servers' => ['your-stomp-instance-and-port'],
'vhost' => 'your-vhost', 'vhost' => 'your-vhost',
'username' => 'your-username', 'username' => 'your-username',
'password' => 'your-password']); 'password' => 'your-password']);
@ -39,4 +39,4 @@ In config.php
addPlugin('StompQueue', ['servers' => 'tcp://localhost:61613', 'vhost' => '/', addPlugin('StompQueue', ['servers' => 'tcp://localhost:61613', 'vhost' => '/',
// Please don't actually use the default credentials // Please don't actually use the default credentials
'username' => 'guest', 'password' => 'guest']); 'username' => 'guest', 'password' => 'guest']);

View File

@ -27,7 +27,7 @@ defined('GNUSOCIAL') || die();
class StompQueuePlugin extends Plugin class StompQueuePlugin extends Plugin
{ {
const PLUGIN_VERSION = '0.0.1'; const PLUGIN_VERSION = '0.1.0';
// settings which can be set in config.php with addPlugin('StompQueue', ['param'=>'value', ...]); // settings which can be set in config.php with addPlugin('StompQueue', ['param'=>'value', ...]);
public $servers = null; public $servers = null;
@ -61,12 +61,15 @@ class StompQueuePlugin extends Plugin
public function onPluginVersion(array &$versions): bool public function onPluginVersion(array &$versions): bool
{ {
$versions[] = array('name' => 'StompQueue', $versions[] = [
'version' => self::PLUGIN_VERSION, 'name' => 'StompQueue',
'author' => 'Miguel Dantas', 'version' => self::PLUGIN_VERSION,
'description' => 'author' => 'Miguel Dantas',
// TRANS: Plugin description. 'homepage' => GNUSOCIAL_ENGINE_URL,
_m('Plugin implementing STOMP as a backend for GNU social queues')); 'description' =>
// TRANS: Plugin description.
_m('Plugin implementing STOMP as a backend for GNU social queues')
];
return true; return true;
} }
}; };

View File

@ -1,14 +0,0 @@
UnQueuePlugin wraps the UnQueueManager class which is a queue manager that does all work immediately.
Installation
============
This plugin is enabled by default and cannot be disabled unless another queue manager is in use.
Disabling is not necessary but recommended in such cases.
Example
=======
In config.php
addPlugin('UnQueue');

10
plugins/UnQueue/README.md Normal file
View File

@ -0,0 +1,10 @@
UnQueuePlugin wraps the UnQueueManager class which is a queue manager that does all the work immediately.
INSTALL
=======
In config.php
addPlugin('UnQueue');
Be sure to disable other queues plugins.

View File

@ -37,12 +37,14 @@ class UnQueuePlugin extends Plugin
public function onPluginVersion(array &$versions): bool public function onPluginVersion(array &$versions): bool
{ {
$versions[] = array('name' => 'UnQueue', $versions[] = ['name' => 'UnQueue',
'version' => self::PLUGIN_VERSION, 'version' => self::PLUGIN_VERSION,
'author' => 'Miguel Dantas', 'author' => 'Miguel Dantas',
'description' => 'homepage' => GNUSOCIAL_ENGINE_URL,
// TRANS: Plugin description. 'description' =>
_m('Plugin using the database as a backend for GNU social queues')); // TRANS: Plugin description.
_m('Plugin using the database as a backend for GNU social queues')
];
return true; return true;
} }
}; };