Pebble has been released and is available from the google code microapps repository. However, it has been deprecated in favor of Cabochon. The code is available for reference purposes but if you actually want to run something in production, use Cabochon instead.
Pebble is an event dispatching and registration service. In other words, it implements sort of an Observer-Observed design pattern but with resources and http requests instead of objects and method calls.
(Pebble uses the Service Pattern)
with pebble, your 'observed' application or resource first creates a uniquely named event:
curl -X PUT -d "" http://pebble.example.com/service/myservice/event/myevent/
other "observer" applications can then register their interest in that event. they sign up with a callback url and method type:
curl -X POST -d "url=http://observer1.example.com/callme;method=POST" \
http://pebble.example.com/service/myservice/event/myevent/add_handler
curl -X POST -d "url=http://observer2.example.com/callmetoo;method=POST" \
http://pebble.example.com/service/myservice/event/myevent/add_handler
then, when something happens that the "observed" application wants to let the world know about, it triggers the event:
curl -X POST -d "" http://pebble.example.com/service/myservice/event/myevent/trigger
pebble will then call all the callback urls that have registered with that event. so making that request, pebble would then do the equivalent of:
curl -X POST -d "" http://observer1.example.com/callme curl -X POST -d "" http://observer2.example.com/callmetoo
behind the scenes.
pebble makes its requests asynchronously (ie, it doesn't wait around for a response). so any callbacks registered should expect anyone to look at their results. this allows pebble to dispatch large numbers of events to large numbers of callback urls very quickly.
pebble also passes along any params sent with the trigger to the callbacks. this is a useful way to provide additional info along with the events. the method type will default to POST if it was not specified when the callback was registered.
