Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version. Compare with Current  |   View Page History

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

Zend Framework: Zend_PubSubHubbub Component Proposal

Proposed Component Name Zend_PubSubHubbub
Developer Notes http://framework.zend.com/wiki/display/ZFDEV/Zend_PubSubHubbub
Proposers Pádraic Brady
Revision 0.1 - 20 July 2009 (wiki revision: 3)

Table of Contents

1. Overview

What is PubSubHubbub?

PubSubHubbub is a Publisher-Subscriber protocol which operates over HTTP using REST. Its purpose is to allow consumers of RSS and Atom feeds to subscribe for updates to a Hub Server for any specific feed. This Hub Server will usually be notified by the publisher of that feed whenever an update in the feed occurs. In turn, the Hub Server may then notify all consumers that an update has occurred by making a request to a URI provided by the consumer, with an Atom/RSS feed containing the updated or new feed entries in the request body. This protocol therefore implements a push system whereby updates are pushed to the consumers in real time (within reason). This is opposed to the current prevailing practice where consumers must frequently poll a publisher's feed URI to check whether any changes have occurred. This imposes a time delay between a publisher making a change and any consumer noticing and retrieving it. The benefits of the push model therefore obviously lie in the immediacy with which consumers can distribute new content to their visitors/users.

PubSubHubbub Specification Status

The PubSubHubbub protocol is not a finalised one. Indeed it is constantly evolving, and this proposal takes that evolution into account using as its basis the current PubSubHubbub Core 0.1 – Working Draft and its reference implementations. As with a number of open specifications in recent years, waiting for a final and stable specification has not prevented the continued rise of implementations and real world use cases. To date, PubSubHubbub has been implemented (publicly) by SuperFeedr and FeedBurner so the protocol is in use right now. There is little justification in holding up adoption when adoptions are already present and PubSubHubbub services are being offered to the public. The specification will evolve over many months, but this is to be expected. Indeed, this reflects experiences with specifications like OAuth which saw widespread adoption and use in the wild long before a final specification was published. Granted, the risk of not becoming a mainstream protocol remains but the progress to date is encouraging.

Technical Details

It's actually quite difficult to make PubSubHubbub sound technically complex. It's a simple protocol using a web-hooks system (i.e. allows you to subscribe to another site's events using a URI), a coordinating Hub Server (which can be anyone since this is a decentralised system - you could be your own hub for all PubSubHubbub cares), and the exchange of simple Atom formatted notifications or messages between all parties. Atom is used here as the notification system's substrate which should be distinguished from the feed resources whose updates are of interest and which can be either Atom or RSS.

The remaining technical details concern the protocol's operation over HTTP (nothing special), the discovery of the various URI endpoints (e.g. how consumers locate the Hub(s) servicing a feed so they can subcribe for updates using that Hub's endpoint URI), and security considerations (for future specs) such as accessing private feeds and ensuring the integrity of messages being exchanged by two parties. Anyone with a passing familiarity of OAuth or OpenID would not be out of their depth since these other open protocols deal with similar topics.

Implementation Details within Zend Framework

The Zend Framework as of version 1.10+ should (assuming successful reviews) package within its stable release an assortment of components which were designed to support a vastly simplified means of reading and writing RSS and Atom feeds, the latter targeting Atom as a general web service substrate. Also included should be the Zend_Crypt component introduced in support of Zend_Oauth. With these three components, implementing PubSubHubbub should be fairly simple. The only real work would be in orchestrating the protocol workflow from the perspective of different parties. For example, we can assume there would be a Zend_PubSubHubbub_HubServer class to implement a Hub Server. In a similar vein, we can also assume the presence of Zend_PubSubHubbub_Subscriber and Zend_PubSubHubbub_Publisher for the remaining two parties in the overall protocol. Adding a storage medium to any party can be supported by Zend_Cache and/or Zend_Db (an interface should be defined so Zend_Db remains optional).

2. References

PubSubHubbub Website http://code.google.com/p/pubsubhubbub/
PubSubHubbub Core 0.1 – Working Draft http://pubsubhubbub.googlecode.com/svn/trunk/pubsubhubbub-core-0.1.html
PSH Page: "Why Polling Sucks" http://code.google.com/p/pubsubhubbub/wiki/WhyPollingSucks

3. Component Requirements, Constraints, and Acceptance Criteria

  • MUST implement PubSubHubbub Core 0.1 – Working Draft
  • SHOULD implement any confirmed modifications to the protocol awaiting specification
  • MUST implement support for Subscribers, Publishers and Hub servers
  • MUST maintain a passing status when tested against the documented compliance test suite

4. Dependencies on Other Framework Components

Zend_Http_Client
Zend_Crypt (potential)
Zend_Feed_Reader
Zend_Feed_Writer (proposed)
Zend_Exception

5. Theory of Operation

html: Notify your Confluence administrator that "Bob Swift Software - HTML Plugin" requires a valid license. Reason: No license found for plugin with key: org.swift.confluence.html. <iframe src="http://docs.google.com/present/embed?id=ajd8t6gk4mh2_34dvbpchfs&size=m" frameborder="0" width="555" height="451"></iframe>

6. Milestones / Tasks

  • Milestone 1: Publish and have proposal approved with Zend comments to resolve
  • Milestone 2: Complete initial component with unit tests
  • Milestone 3: Complete/Maintain testing against the compliance test suite
  • Milestone 4: Verify that code operates under PHP 5.3/6.0-dev
  • Milestone 5: Complete documentation

7. Class Index

  • Zend_PubSubHubbub
  • Zend_PubSubHubbub_Exception
  • Zend_PubSubHubbub_HubServer
  • Zend_PubSubHubbub_Subscriber
  • Zend_PubSubHubbub_Publisher
  • Zend_PubSubHubbub_StorageInterface
  • Zend_PubSubHubbub_Notification

Others may be determined during development

8. Use Cases

Use cases are currently being drafted.

9. Class Skeletons

Skeleton Classes will be published as they are completed. Component will follow a Test-Driven Design methodology.

]]></ac:plain-text-body></ac:macro>

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.