gnu-social/plugins/OpportunisticQM
Diogo Cordeiro c18f26145c [CORE] Move core plugins to a new modules directory
For reference (raised by rozzin in IRC):

* http://foldoc.org/module
* http://foldoc.org/library
* http://foldoc.org/plugin

As noted by XRevan86, modules are not necessarily non-essential.
As we will keep the modules directory in GS root [therefore, near to
plugins/], it is evidenced the difference between both.

This is a simple yet fundamental structural change. It doesn't change
functionality but makes clearer the way we understand GNU social's
internals.
2021-07-16 19:44:33 +01:00
..
actions Cron split into Cronish and OpportunisticQM 2013-11-20 21:20:42 +01:00
lib use connect_timeout value for execution margin 2016-01-22 12:19:17 +01:00
locale [CORE] Move core plugins to a new modules directory 2021-07-16 19:44:33 +01:00
OpportunisticQMPlugin.php [ROUTES] Allow accept-header specification during router creation 2019-08-03 17:47:16 +01:00
README array need to contain key/value pairs 2016-01-14 12:39:39 +01:00

Generally the OpportunisticQM plugin will run if there's still execution 
time for 1 second since starting the Action processing. If you want to 
change this (such as disabling, 0 seconds, or maybe running bigger 
chunks, for like 4 seconds) you can do this, where 'n' is time in seconds.

addPlugin('OpportunisticQM', array('secs_per_action' => n));

Add 'rel_to_pageload'=>false to the array if you want to run the queue 
for a certain amount of seconds _despite_ maybe already having run that 
long in the previous parts of Action processing.

Perhaps you want to start the queue handler remotely, using a machine capable 
of background processing (or locally, to avoid running PHP daemon processes), 
simply do an HTTP GET request to the route /main/runqueue of your GNU social. 
Setting secs_per_action to 0 in the plugin config will imply that you run 
all your queue handling by calling /main/runqueue (which runs as long as it 
can).

/main/runqueue will output "0" if it has finished processing, "1" if it 
should be called again to complete processing (because it shut down to avoid
to PHP's max_execution_time INI setting).

The key-required functionality is not throughly tested yet, so testing 
would be appreciated.