summaryrefslogtreecommitdiff
path: root/scripts/publicqueuehandler.php
AgeCommit message (Collapse)Author
2010-01-12Major refactoring of queue handlers to support running multiple sites in one ↵Brion Vibber
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
2009-08-25a distributed -> the distributedEvan Prodromou
2009-08-25change Laconica and Control Yourself to StatusNet in PHP filesEvan Prodromou
2009-06-24all daemons take an id parameterEvan Prodromou
2009-06-22fix have_options argumentsEvan Prodromou
2009-06-22publicqueuehandler uses commandlineEvan Prodromou
2009-06-22Merge branch '0.8.x' into cmdlineEvan Prodromou
2009-06-20Update copyright dates in files modified in 2009Evan Prodromou
2009-06-20change Controlez-Vous to Control YourselfEvan Prodromou
2009-06-20change scripts to take server and path from commandlineEvan Prodromou
2009-04-16Abort the xmpp-related daemons immediately if xmpp is disabled in the ↵CiaranG
config, otherwise they chew up *lots* of CPU doing nothing
2008-12-23move opening brace of class declaration to next lineEvan Prodromou
Another gigantor PEAR coding standards patch. Here, I've moved the opening curly bracket on a class statement to the following line. darcs-hash:20081223194923-84dde-77a93de314caadbcb5b70bf346a4648be77a864e.gz
2008-12-23change function headers to K&R styleEvan Prodromou
Another huge change, for PEAR code standards compliance. Function headers have to be in K&R style (opening brace on its own line), instead of having the opening brace on the same line as the function and parameters. So, a little perl magic found all the function definitions and move the opening brace to the next line (properly indented... usually). darcs-hash:20081223193323-84dde-a28e36ecc66672c783c2842d12fc11043c13ab28.gz
2008-12-23replace all tabs with four spacesEvan Prodromou
The PEAR coding standards decree: no tabs, but indent by four spaces. I've done a global search-and-replace on all tabs, replacing them by four spaces. This is a huge change, but it will go a long way to getting us towards phpcs-compliance. And that means better code readability, and that means more participation. darcs-hash:20081223191907-84dde-21e8efe210e6d5d54e935a22d0cee5c7bbfc007d.gz
2008-09-13LOG_ERROR -> LOG_ERREvan Prodromou
darcs-hash:20080913161107-84dde-30b694455d509a7ec2d12e8418f54ce695aa0993.gz
2008-09-04abstract XMPP-related queue handling to a common superclassEvan Prodromou
darcs-hash:20080904194035-84dde-480b3605862d26eff6a2cac6eec02775628287e4.gz
2008-09-04scripts daemonize themselvesEvan Prodromou
darcs-hash:20080904184031-84dde-eba2061f3aa898d0c791ffeb70837f759778c567.gz
2008-09-04Fix typo in presence message (x3)CiaranG
darcs-hash:20080904081542-f6e2c-33b65962d067d142cbdca727625a1b6cc0b30ba4.gz
2008-09-02variable name conflict on reconnectEvan Prodromou
darcs-hash:20080902172039-84dde-2b1bbac407959af2a5ca0c764aa503f0cb05c785.gz
2008-09-02set the reconnect timeoutEvan Prodromou
darcs-hash:20080902171740-84dde-ee629f4b5dbcf712cd350c37d0f1814ca1b7f237.gz
2008-09-02better connection handling in scriptsEvan Prodromou
darcs-hash:20080902165735-84dde-e522711214832e6f992b9897aaf8904b1d5c6a2e.gz
2008-09-02add reconnect handlers to main XMPP-handling scriptsEvan Prodromou
darcs-hash:20080902165319-84dde-b6cc255f014e6c5c059905c37c258a6c7a53b39a.gz
2008-08-30switch around how XMLStream does processingEvan Prodromou
darcs-hash:20080831003210-84dde-92ccffd5b2e1d50963b18babd93c70fb1d20cdba.gz
2008-09-01dnd -> available, just looks bad as dnsEvan Prodromou
darcs-hash:20080902030910-84dde-01fa58c8c1ab359a077c7a5498973235954be085.gz
2008-09-01separate out presence from connection, send different presence types from ↵Evan Prodromou
queuehandlers darcs-hash:20080902012604-84dde-073a583da9b09c80e5e9a47a5eddd144fad8e87a.gz
2008-08-30add some sanity-check stuff for long-running daemonsEvan Prodromou
darcs-hash:20080831023844-84dde-b8c9ce5f38d33c7fd8a42dc0d3640d500e653011.gz
2008-08-30add initialization info to the queue handlersEvan Prodromou
darcs-hash:20080831020325-84dde-606d52b08146d4c226f812a9f47b5a3ec1abc743.gz
2008-08-30public queue handler and xmpp confirm handler service their message queuesEvan Prodromou
darcs-hash:20080830172217-84dde-b5501719421b84ea1ee8346cf8a5ad170fd1db88.gz
2008-08-29fix name of instantiated classEvan Prodromou
darcs-hash:20080829182112-84dde-c29ccd959e19e18cc2ceac1ba701f351f914c26b.gz
2008-08-29split public stream to its own queue handlerEvan Prodromou
Add another queue handler for the public stream. Should further parallelize the work of sending out messages. darcs-hash:20080829181702-84dde-594505aa73d2380b13bd98917b70b02bac597d12.gz