Lazyshot/storm-php — pull request #2 by jimrubenstein (2011-12-01 19:59:02+00:00)
Title: moving code around and removing interfaces

In a Spout, run doesn't really need to be re-implemented unless the user really needs to. All that needs to be implemented is the nextTuple method, and basic functionality for ack and fail. If the user needs more, they can override it, but a basic Spout needs nothing more than those 3 methods.

The same is true for a bolt. The run method in a bolt always basically the same. There are 2 bolt classes in the lib, one doesn't take advantage of the "Reliability API" (emitting anchor tuples with along with the transformed tuple) and the other does. In the basic case, implementing the Reliability API is still possible, but the user is responsible for keetping track of the anchor tuple, and calling ack. If the user extends the BasicBolt, this functionality is handeled for them. In most bolts, all that needs to be implemented is the process method. This is the method that is called when a new tuple is received from the Storm process.

Removed the interface definitions, they're pretty useless for us here - abstract classes are enough to handle them.
Added a try/catch statement to the basic bolt that will catch any exceptions that are thrown by the process method (or deeper) and fail the tuple (using the reliability api) so it gets reprocessed at another time.