gnu-social/classes
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
..
Avatar.php ...and drop the unnecessary &reference from child class pkeyGet() overrides. 2010-01-06 14:28:40 -08:00
Config.php ...and drop the unnecessary &reference from child class pkeyGet() overrides. 2010-01-06 14:28:40 -08:00
Confirm_address.php change function headers to K&R style 2008-12-23 14:33:23 -05:00
Consumer.php change function headers to K&R style 2008-12-23 14:33:23 -05:00
Deleted_notice.php check correct define (not backwards compatible) 2009-09-15 21:12:44 -04:00
Design.php use the new htmloutputter->style() function 2009-12-04 20:20:44 -05:00
Fave.php ...and drop the unnecessary &reference from child class pkeyGet() overrides. 2010-01-06 14:28:40 -08:00
File_oembed.php check before saving a thumbnail 2010-01-10 13:25:16 -08:00
File_redirection.php Revert "Remove more contractions" 2009-11-09 20:01:46 +01:00
File_thumbnail.php define LACONICA and accept LACONICA for backwards compatibility 2009-08-26 10:41:36 -04:00
File_to_post.php ...and drop the unnecessary &reference from child class pkeyGet() overrides. 2010-01-06 14:28:40 -08:00
File.php Merge branch 'master' into 0.9.x 2010-01-10 14:18:19 -08:00
Foreign_link.php Take token field out of foreign_link 2009-08-25 15:48:06 -04:00
Foreign_service.php change function headers to K&R style 2008-12-23 14:33:23 -05:00
Foreign_subscription.php change function headers to K&R style 2008-12-23 14:33:23 -05:00
Foreign_user.php change foreign_user.id to bigint (for Twitter, Facebook, etc.) 2009-06-24 14:44:02 -07:00
Group_alias.php define LACONICA and accept LACONICA for backwards compatibility 2009-08-26 10:41:36 -04:00
Group_block.php ...and drop the unnecessary &reference from child class pkeyGet() overrides. 2010-01-06 14:28:40 -08:00
Group_inbox.php ...and drop the unnecessary &reference from child class pkeyGet() overrides. 2010-01-06 14:28:40 -08:00
Group_member.php ...and drop the unnecessary &reference from child class pkeyGet() overrides. 2010-01-06 14:28:40 -08:00
Invitation.php change function headers to K&R style 2008-12-23 14:33:23 -05:00
Location_namespace.php flip x flag on generated files 2009-10-21 22:43:41 -04:00
Login_token.php Redirect to a one-time-password when ssl and regular server are different 2010-01-09 15:26:06 -08:00
Memcached_DataObject.php Major refactoring of queue handlers to support running multiple sites in one daemon. 2010-01-12 20:45:09 -08:00
Message.php create a method for notification for new messages, and use it 2009-12-15 10:31:25 -05:00
Nonce.php Fix nonce usage in OAuth store 2009-03-07 12:55:09 -08:00
Notice_inbox.php ...and drop the unnecessary &reference from child class pkeyGet() overrides. 2010-01-06 14:28:40 -08:00
Notice_source.php change function headers to K&R style 2008-12-23 14:33:23 -05:00
Notice_tag.php ...and drop the unnecessary &reference from child class pkeyGet() overrides. 2010-01-06 14:28:40 -08:00
Notice.php Fixes to bugs where non-local messages were being wrong put in the public timeline and public xmpp feed 2010-01-07 20:59:31 +00:00
Profile_block.php define LACONICA and accept LACONICA for backwards compatibility 2009-08-26 10:41:36 -04:00
Profile_role.php ...and drop the unnecessary &reference from child class pkeyGet() overrides. 2010-01-06 14:28:40 -08:00
Profile_tag.php fix problem with dupe tags in profile 2009-02-28 15:17:49 -08:00
Profile.php Fix for broken profile flag admin UI: delete stray flag entries when users are deleted so broken entries don't litter the lookups. 2010-01-06 11:10:33 -08:00
Queue_item.php Major refactoring of queue handlers to support running multiple sites in one daemon. 2010-01-12 20:45:09 -08:00
Related_group.php some class files had x bit set 2009-05-22 21:11:46 -04:00
Remember_me.php change function headers to K&R style 2008-12-23 14:33:23 -05:00
Remote_profile.php Fix regression in remote subscription; added hasRole() shadow method on Remote_profile. 2009-11-25 22:23:21 +00:00
Reply.php Ticket #1567 - API: Change before_id parameter to max_id 2009-05-29 16:32:55 -07:00
Session.php don't write session if it's unchanged 2009-10-09 10:39:56 -04:00
Sms_carrier.php change function headers to K&R style 2008-12-23 14:33:23 -05:00
status_network.ini Rename Laconica to StatusNet 2009-08-25 17:56:10 -04:00
Status_network.php Major refactoring of queue handlers to support running multiple sites in one daemon. 2010-01-12 20:45:09 -08:00
statusnet.ini Cache fixes: 2010-01-05 15:05:53 -08:00
statusnet.links.ini Remove relationship: user_openid.user_id -> user.id. I don't think this 2009-11-25 23:55:03 +00:00
Subscription.php ...and drop the unnecessary &reference from child class pkeyGet() overrides. 2010-01-06 14:28:40 -08:00
Token.php change function headers to K&R style 2008-12-23 14:33:23 -05:00
User_group.php Consolidate group creation into static function in User_group 2009-11-18 15:54:24 -05:00
User_location_prefs.php Add magic formula to keep DB_DataObject from treating location prefs pkey as autoincrement 2009-12-30 08:56:43 -10:00
User_username.php Move Authorization and Authentication plugin structures into core, instead of as plugins. 2010-01-05 13:56:22 -05:00
User.php More configuration options for location sharing 2009-12-28 15:58:58 -08:00