gnu-social/scripts
Brion Vibber ec145b73fc Major refactoring of queue handlers to support running multiple sites in one daemon.
Key changes:
* Initialization code moved from common.php to StatusNet class;
  can now switch configurations during runtime.
* As a consequence, configuration files must now be idempotent...
  Be careful with constant, function or class definitions.
* Control structure for daemons/QueueManager/QueueHandler has been refactored;
  the run loop is now managed by IoMaster run via scripts/queuedaemon.php
  IoManager subclasses are woken to handle socket input or polling, and may
  cover multiple sites.
* Plugins can implement notice queue handlers more easily by registering a
  QueueHandler class; no more need to add a daemon.

The new QueueDaemon runs from scripts/queuedaemon.php:

* This replaces most of the old *handler.php scripts; they've been refactored
  to the bare handler classes.
* Spawns multiple child processes to spread load; defaults to CPU count on
  Linux and Mac OS X systems, or override with --threads=N
* When multithreaded, child processes are automatically respawned on failure.
* Threads gracefully shut down and restart when passing a soft memory limit
  (defaults to 90% of memory_limit), limiting damage from memory leaks.
* Support for UDP-based monitoring: http://www.gitorious.org/snqmon

Rough control flow diagram:
QueueDaemon -> IoMaster -> IoManager
                           QueueManager [listen or poll] -> QueueHandler
                           XmppManager [ping & keepalive]
                           XmppConfirmManager [poll updates]

Todo:

* Respawning features not currently available running single-threaded.
* When running single-site, configuration changes aren't picked up.
* New sites or config changes affecting queue subscriptions are not yet
  handled without a daemon restart.
* SNMP monitoring output to integrate with general tools (nagios, ganglia)
* Convert XMPP confirmation message sends to use stomp queue instead of polling
* Convert xmppdaemon.php to IoManager?
* Convert Twitter status, friends import polling daemons to IoManager
* Clean up some error reporting and failure modes
* May need to adjust queue priorities for best perf in backlog/flood cases

Detailed code history available in my daemon-work branch:
http://www.gitorious.org/~brion/statusnet/brion-fixes/commits/daemon-work
2010-01-12 20:45:09 -08:00
..
allsites.php a distributed -> the distributed 2009-08-25 18:14:12 -04:00
checkschema.php make checkschema.php executable (which makes sense, cause the README says to run it :-) ) 2009-11-30 17:00:00 -05:00
cleardb.sh clear and rebuild db scripts 2008-09-22 15:58:24 -04:00
commandline.inc define LACONICA for compatibility on scripts 2009-10-13 13:34:28 -04:00
console.php suppress notice for undefined prompt variable when console.php is used from non-interactive terminal 2010-01-06 13:08:56 -08:00
createsim.php free some memory in createsim.php 2010-01-04 22:49:09 -10:00
decache.php a distributed -> the distributed 2009-08-25 18:14:12 -04:00
delete_status_network.sh global search and replace for laconica -> statusnet 2009-08-25 18:53:24 -04:00
deleteuser.php fix long options on deleteuser.php 2010-01-11 13:24:40 -08:00
fixup_conversations.php define LACONICA for compatibility on scripts 2009-10-13 13:34:28 -04:00
fixup_hashtags.php define LACONICA and accept LACONICA for backwards compatibility 2009-08-26 10:41:36 -04:00
fixup_inboxes.php define LACONICA and accept LACONICA for backwards compatibility 2009-08-26 10:41:36 -04:00
fixup_notices_rendered.php define LACONICA and accept LACONICA for backwards compatibility 2009-08-26 10:41:36 -04:00
fixup_replies.php define LACONICA and accept LACONICA for backwards compatibility 2009-08-26 10:41:36 -04:00
fixup_utf8.php Code style cleanup: dropped some unnecessary =& reference assignments where they're used only out of habit for PHP 4-style object semantics 2009-12-03 12:58:48 -08:00
getpiddir.php a distributed -> the distributed 2009-08-25 18:14:12 -04:00
getvaliddaemons.php Major refactoring of queue handlers to support running multiple sites in one daemon. 2010-01-12 20:45:09 -08:00
handlequeued.php Major refactoring of queue handlers to support running multiple sites in one daemon. 2010-01-12 20:45:09 -08:00
inbox_users.php a distributed -> the distributed 2009-08-25 18:14:12 -04:00
maildaemon.php Add an IMAP daemon so StatusNet can process incoming user posts via catch-all mailbox (in addition to the pre-existing script alias method) 2010-01-08 18:52:43 -05:00
makegroupadmin.php script to make someone a group admin 2009-11-02 18:06:27 -05:00
queuedaemon.php Major refactoring of queue handlers to support running multiple sites in one daemon. 2010-01-12 20:45:09 -08:00
rebuilddb_psql.sh global search and replace for laconica -> statusnet 2009-08-25 18:53:24 -04:00
rebuilddb.sh clear and rebuild db scripts 2008-09-22 15:58:24 -04:00
registeruser.php Revert "* [Cc]an't -> [Cc]annot" 2009-11-08 23:28:51 +01:00
reportsnapshot.php a distributed -> the distributed 2009-08-25 18:14:12 -04:00
SearchMonkey-MrH.0.txt Updated URL patterns for identica Profiles for YahooSearchMonkey app. 2009-03-09 19:43:46 +00:00
SearchMonkey-Om3.0.txt Updated URL patterns for identica Profiles for YahooSearchMonkey app. 2009-03-09 19:43:46 +00:00
SearchMonkey-yQP.0.txt Updated URL patterns for identica Profiles for YahooSearchMonkey app. 2009-03-09 19:43:46 +00:00
sessiongc.php Revert "Open tags should have closing tags" 2009-10-08 11:41:39 -04:00
setconfig.php add setconfig.php script to set configuration options 2009-12-24 15:13:30 -08:00
setpassword.php a distributed -> the distributed 2009-08-25 18:14:12 -04:00
setup_status_network.sh Grand ALL permissions to the DB user when setting up a new status.net site. 2009-12-07 11:34:03 -08:00
setup.cfg.sample use different name for connection and database 2009-06-23 11:22:54 -07:00
showcache.php a distributed -> the distributed 2009-08-25 18:14:12 -04:00
showtable.php statusize schema-related modules 2009-09-23 09:20:04 -04:00
sitemap.php Revert "* [Cc]an't -> [Cc]annot" 2009-11-08 23:28:51 +01:00
startdaemons.sh have to provide full path for daemons 2009-09-21 14:42:20 -04:00
statusnet.spec last scrub of Laconica -> StatusNet 2009-08-26 03:33:43 -04:00
stopdaemons.sh Add an RSSCloud queue handler daemon 2010-01-05 23:19:13 -08:00
triminboxes.php Add progress output and optional --sleep-time parameter to triminboxes.php 2009-12-29 14:16:22 -08:00
uncache_users.php a distributed -> the distributed 2009-08-25 18:14:12 -04:00
update_po_templates.php New _m() gettext wrapper with smart detection of plugin domains. Plugin base class registers your gettext files if present at initialization. 2009-12-08 12:17:11 -08:00
update_translations.php Do not rebuild/add .mo files by default 2009-12-03 00:28:00 +01:00
updateavatarurl.php Tweak updateavatarurl.php: emit a newline whether we're on verbose or non-quiet, emit help when no users specified. 2009-12-08 08:30:30 -08:00
updatelocation.php Script to update the location ID for users 2009-12-31 12:38:58 -10:00
useremail.php Make useremail.php executable 2009-12-11 13:14:40 -08:00
userrole.php script for granting/revoking user roles 2009-11-07 22:35:35 -05:00
xmppdaemon.php Lots of tiny message changes. 2010-01-10 12:26:24 +01:00