gnu-social/plugins/RSSCloud
Brion Vibber 26fdf0c9d2 XMPP queued output & initial retooling of DB queue manager to support non-Notice objects.
Queue handlers for XMPP individual & firehose output now send their XML stanzas
to another output queue instead of connecting directly to the chat server. This
lets us have as many general processing threads as we need, while all actual
XMPP input and output go through a single daemon with a single connection open.

This avoids problems with multiple connected resources:
* multiple windows shown in some chat clients (psi, gajim, kopete)
* extra load on server
* incoming message delivery forwarding issues

Database changes:
* queue_item drops 'notice_id' in favor of a 'frame' blob.
  This is based on Craig Andrews' work branch to generalize queues to take any
  object, but conservatively leaving out the serialization for now.
  Table updater (preserves any existing queued items) in db/rc3to09.sql

Code changes to watch out for:
* Queue handlers should now define a handle() method instead of handle_notice()
* QueueDaemon and XmppDaemon now share common i/o (IoMaster) and respawning
  thread management (RespawningDaemon) infrastructure.
* The polling XmppConfirmManager has been dropped, as the message is queued
  directly when saving IM settings.
* Enable $config['queue']['debug_memory'] to output current memory usage at
  each run through the event loop to watch for memory leaks

To do:
* Adapt XMPP i/o to component connection mode for multi-site support.
* XMPP input can also be broken out to a queue, which would allow the actual
  notice save etc to be handled by general queue threads.
* Make sure there are no problems with simply pushing serialized Notice objects
  to queues.
* Find a way to improve interactive performance of the database-backed queue
  handler; polling is pretty painful to XMPP.
* Possibly redo the way QueueHandlers are injected into a QueueManager. The
  grouping used to split out the XMPP output queue is a bit awkward.
2010-01-21 16:42:50 -08:00
..
LoggingAggregator.php Some phpcs cleanup 2010-01-05 23:21:57 -08:00
README Some better log msgs 2010-01-06 07:44:34 +00:00
RSSCloudNotifier.php Some phpcs cleanup 2010-01-05 23:21:57 -08:00
RSSCloudPlugin.php XMPP queued output & initial retooling of DB queue manager to support non-Notice objects. 2010-01-21 16:42:50 -08:00
RSSCloudQueueHandler.php XMPP queued output & initial retooling of DB queue manager to support non-Notice objects. 2010-01-21 16:42:50 -08:00
RSSCloudRequestNotify.php Some better log msgs 2010-01-06 07:44:34 +00:00
RSSCloudSubscription.php Better .ini info for RSSCloud subscription 2010-01-05 23:18:58 -08:00

This plugin enables RSSCloud (http://rsscloud.org/) publishing and
subscription handling for RSS 2.0 profile feeds (i.e:
http://SITE/PATH/api/statuses/user_timeline/USERNAME.rss). When the
plugin is enabled, StatusNet acts as both the publisher and hub ('writer' and
'cloud' in RSSCloud parlance), but only for local StatusNet feeds. It's
not possible to use it as a general purpose hub -- for instance you can't
subscribe and get updates to a Wordpress feed from StatusNet using this
plugin.

To use the plugin, add the following to your config.php:

    addPlugin('RSSCloud');

Enabling the plugin will add a <cloud> element to your RSS 2.0 profile feeds
that looks like this:

    <cloud domain="SITE" port="80" path="/main/rsscloud/request_notify"
    registerProcedure="" protocol="http-post"/>

Aggregators may subscribe by sending a proper REST RSSCloud subscription
request (the optional 'domain' parameter with challenge is supported).
Subscribing aggregators will be notified ('pinged') when users they have
subscribed to post new notices. Currently, REST is the only protocol
supported for notifications.

Deamon
------

There's also a daemon for offline processing of queued notices with
RSSCloud destinations, which will start automatically if/when you run
scripts/startdaemons.sh.

Notes
-----

- Again, only RSS 2.0 profile feeds may be subscribed to, and they have
  to be the ones with user names in them, like:
      http://SITE/PATH/api/statuses/user_timeline/USERNAME.rss
- Subscriptions are deleted after three notification failures in a row
  (not sure this is optimal).
- The plugin includes a dummy LoggingAggregator class that can be used
  for end-to-end testing.  You probably don't want to mess with it.

TODO
----

- Figure out why the RSSCloudSubcription can't ->delete() or ->update()
- Support pinging via XML-RPC and SOAP
- Automatically delete subscriptions? Point of reference: Dave's hub
  implementation auto-deletes them after 25 hours. WordPress never deletes them.
- Support additional feed URL addresses for the same feed (e.g.: by numeric ID,
  ?user_id=xxx, etc.)
- Support additional feeds that make sense (e.g: replies)?
- Possibly use "rssCloud" (like Dave) instead of "RSSCloud" everywhere