PubSubHubbub is a callback-based web protocol.
I put them together and the result is a PubSubHubbub client for NodeJS:
node-pshb on github
This project only includes a PubSubHubbub client interface, but to me that's the interesting part. You can specify an atom feed url, and functions to call when events happen on that feed due to PubSubHubbub.
The client library takes care of identifying the hub for that feed, requesting a subscription, and listening for subscription confirmation requests and feed updates from the hub.
It provides callback hooks for "subscribed", "update" and "error" events.
A simple client app looks like this:
var callbackPort = 4443; var subscriber = new pshb.Subscriber(callbackPort); // Start listening for subscription confirmation callbacks. subscriber.startCallbackServer(); var topicUri = url.parse("http://localhost/foo"); // Dummy feed, always has updates var feedEvents = subscriber.listen(topicUri); feedEvents.addListener('subscribed', function(atomFeed) { sys.puts('subscribed: ' + atomFeed.id); }); feedEvents.addListener('error', function(error) { sys.puts('ERROR: ' + error); }); feedEvents.addListener('update', function(atomFeed) { sys.puts('got a PubSubHubub update: ' + atomFeed.id); });
I tested this out with the Demo Hub running on a local AppEngine launcher.
The demo app creates a a second server to host a dummy feed on port 80, so http://localhost/foo always returns a feed with the current time as it's "last updated." This is so the test hub always thinks there's an update ready for you.
So start the appengine with the hub running locally (in this demo it's assumed to be on port 8086), then run the test.js app, then go to your hub with your browser and manually update http://localhost/foo.
I noticed that I had to manually run some tasks in the hub's work queue so if you don't see any updates try checking the Task Queues in the app console for the hub. Run any pending "feed-pulls" and "event-delivery" tasks. I imagine there's a way to make them do that automatically but I haven't dug around enough in there to find it.
So there you go, NodeJS and PubSubHubbub: it's callbacks all the way down.
I know about NodeJS and it's amazing evented IO, but I know nothing about PSHB. It might be nice to be explicit about the benefits of what you've done here. I do the same thing with my code, feeling that the benefit is astoundingly obvious, but most people don't even know what I've shown them. This is especially the case when your project depends on two very niche technologies: the people that know one library is small; the people who know them both are vanishingly small.
ReplyDeleteGood point, Josh- I guess after I write a bunch of code to do something I think is neat, I'm often too exhausted to write very much about why I think it's neat :)
ReplyDeleteI'll write a proper post on this later, but I see NodeJS and PSHB as sort of parallel developments. They're both built on asynchronous callback notifications as a way to use resources more efficiently.
Node is fast because it's non-blocking and evented. Everything is a callback. You register interest in specific events from sockets or other IO objects, and Node calls your callback whenever there's new data.
NodeJS uses threads more efficiently than the standard blocking model.
PSHB is a way to do callbacks between web applications, so you can register interest in some URL with a hub, and a hub calls your web application whenever that URL has updates. So you don't have to poll over and over, checking to see if anything has changed.
PSHB uses network resources more efficiently than the standard polling model.
I have a larger application in mind to demonstrate how this stuff can be used together but it's not ready yet. I figure I'll post some notes here as I make progress, even if it isn't immediately useful to anyone.
This site is called --verbose for a reason ;)
This is awesome! I'm going to add a link to this to the PubSubHubbub wiki if you don't mind.
ReplyDeleteUseful & Great Article for NodeJS Development
DeleteNode.js Training | Node js Online Course | Node.js Essential Training | Node.js Online Training | Node.js Training in Chennai
AngularJS Training in Chennai AngularJS Training in Chennai Node.js Training in CHennai Angular 2 Training in Chennai Angular 2 Training in Chennai Node.js Training in CHennai Node.js Training in chennai MEAN Developer Training in Chennai
DeleteBackBoneJS Training in Chennai BackBoneJS Training in Chennai EmberJS Training in Chennai EmberJS Training in Chennai
A IEEE project is an interrelated arrangement of exercises, having a positive beginning and end point and bringing about an interesting result in Engineering Colleges for a particular asset assignment working under a triple limitation - time, cost and execution. Final Year Project Domains for CSE In Engineering Colleges, final year IEEE Project Management requires the utilization of abilities and information to arrange, plan, plan, direct, control, screen, and assess a final year project for cse. The utilization of Project Management to accomplish authoritative objectives has expanded quickly and many engineering colleges have reacted with final year IEEE projects Project Centers in Chennai for CSE to help students in learning these remarkable abilities.
DeleteSpring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Spring Framework Corporate TRaining the authors explore the idea of using Java in Big Data platforms.
Specifically, Spring Framework provides various tasks are geared around preparing data for further analysis and visualization. Spring Training in Chennai
@onebigfluke.com Not at all, please do! :)
ReplyDeleteHey. Are you part of the blogger team. Can you explain how I can get someone from blogger to address a complaint. I killed this blog addy, http://www.emptywoundhopefulheart.blogspot.com about three yrs ago. Some spammer reclaimed it, but they are using an unathorized pic of my small children who are minors. I'm pretty pissed off, especially since blogger seems to be ignoring the issue. Thanks.
ReplyDeletemichael kors handbags
ReplyDeletefitflop sandals
air jordan shoes
nike clearance store
hollister outlet
gucci handbags
salomon boots
louboutin outlet
gucci handbags
cheap nike air max
ferragamo shoes sale
cheap vans
cheap coach handbags
abercrombie & fitch
coach factory outlet
coach outlet online
coach outlet
nike running
michael kors handbags clearance 75% off
michael kors outlet
air jordan 6
coach outlet
kate spade outlet online
cheap coach purses
mont blanc pens sale
fitflop shoes
tod's
north face outlet 70% off
michael kors bags
supra shoes
the north face jackets
discount nike
converse outlet
air jordan 11
ralph lauren polo shirts
vans store
abercrombie and fitch outlet store
20151102yxj-1
fitflop outlet
ReplyDeletemichael kors purses sale
mbt outlet
coach purse
abercrombie and fitch outlet
jordans for sale
fendi bags
fitflop shoes
ugg boots on sale 70% off
north face clearance
columbia outlet store
mont blanc
all jordan shoes
north face clearance
michael kors handbags
coach bags
puma shoes
coach outlet store online
cheap jordans
burberry scarf
gucci shoes
dior outlet
coach factory outlet
nike high heels online
jordan 11
juicy couture outlet
michael kors outlet store
nike factory outlet
new balance outlet store
michael kors outlet
hermes outlet
lebron james shoes
coach bags sale
cheap nfl
hollister outlet store
michael kors outlet
coach purse
20151102yxj-2
nike roshe run
ReplyDeletenba jerseys
soccer jerseys
ralph lauren,polo ralph lauren,ralph lauren outlet,ralph lauren italia,ralph lauren sito ufficiale
michael kors handbags
asics,asics israel,asics shoes,asics running shoes,asics israel,asics gel,asics running,asics gel nimbus,asics gel kayano
thomas sabo outlet
michael kors outlet
michael kors outlet
true religion canada
true religion outlet
beats by dre
michael kors outlet store
michael kors outlet store
prada shoes
true religion jeans
snapbacks wholesale
hermes belt
michael kors handbags
timberland boots
soccer jerseys wholesale
louis vuitton handbags
true religion jeans outlet
louis vuitton outlet
mbt shoes outlet
swarovski outlet
swarovski crystal
louis vuitton handbags outlet
links of london
longchamp handbags outlet
michael kors online outlet
adidas outlet
cheap mlb jerseys
cheap nhl jerseys
louis vuitton outlet store
20160224caihuali
Interesting Article
ReplyDeleteJavascript Training in Chennai | HTML5 Online Training
JavaScript Training Courses | Javascript Online Training | Angular 2 Training in Chennai
discount oakley sunglasses
ReplyDeleteugg boots
moncler outlet online
pandora charms
longchamp sale
nike blazer low pas cher
michael kors outlet online
jimmy choo shoes
hejixia20161202
coach outlet store
ReplyDeletejimmy choo
adidas nmd runner
replica rolex
michael kors handbags outlet
rolex replica
yeezy boost 350 black
coach outlet online
cheap nfl jerseys wholesale
cheap oakley sunglasses
Thanks a lot for sharing this with all of us, I like it and we can communicate. Do you need buy app ratings and reviews. To boost app ranking and double app downloads now.
ReplyDeleteferragamo shoes
ReplyDeleteadidas outlet
moncler outlet
coach outlet
canada goose jackets
michael kors outlet store
uggs
cheap jordans
coach factory outlet
moncler jackets outlet
linpingping10.25
Hello There. I found your blog using msn. This is an extremely well written article. I will be sure to bookmark it and return to read more of your useful information. Thanks for the post. I’ll certainly comeback. TutuHelper
ReplyDeleteMost of the time I don’t make comments on websites. but I'd like to say that this article really forced me to do so. Really nice post! TutuAPp Andorid
ReplyDeleteYou know your projects stand out of the herd. There is something special about them. It seems to me all of them are really brilliant! tutuvip
ReplyDeleteteen patti apk download
ReplyDeleteteen patti apk download
best hookup apps
best hookup sites
best text chat sites
omegle alternative text sites
download play store pro apk free
download play store pro free apk
download play store pro apk free
download free play store pro
Spotify Premium Apk
ReplyDeleteFake Gps Pokemon Go
Fake Gps Pokemon Go
Fake Gps Pokemon Go Joystick
Spotify Premium Apk
Pokemon Go Joystick
Spotify Premium Apk
Spotify Premium Apk
Best Nursing Diagnosis
ReplyDeleteBest Nursing Diagnosis
Best Nursing Diagnosis
Best Nursing Diagnosis
Best Nursing Diagnosis
Best Nursing Diagnosis
Best Nursing Diagnosis
Best Nursing Diagnosis
Best Nursing Diagnosis
Nice Article Very Helpful ! Thanks for sharing ! Also check
ReplyDeleteTutuapp
Pretty blog, so many ideas in a single site, thanks for the informative article, keep updating more article.
ReplyDeletehadoop training in chennai
angularjs training in chennai
Kanhasoft is the top-notch Node.js development company in India. We have 45+ experienced programmers to delivered successful NodeJS Application development globally. Visit our site to know more about us.
ReplyDeletemoncler outlet
ReplyDeletepandora jewelry
hermes outlet
undefeated clothing
michael kors
nike shoes
oakley sunglasses
prada handbags
moncler jackets
kate spade handbags
chenyingying20181017
tutu helper apk
ReplyDeleteExcellent Blog. Thank you so much for sharing.
ReplyDeletehadoop interview questions
Hadoop interview questions for experienced
Hadoop interview questions for freshers
top 100 hadoop interview questions
frequently asked hadoop interview questions
hadoop interview questions and answers for freshers
hadoop interview questions and answers pdf
hadoop interview questions and answers
hadoop interview questions and answers for experienced
hadoop interview questions and answers for testers
hadoop interview questions and answers pdf download
hadoop interview questions pdf
Thanks for sharing valuable information.
ReplyDeleteDigital Marketing training Course in chennai
digital marketing training institute in chennai
digital marketing training in Chennai
digital marketing course in Chennai
digital marketing course training in omr
digital marketing certification in omr
digital marketing course training in velachery
digital marketing training center in chennai
digital marketing courses with placement in chennai
digital marketing certification in chennai
digital marketing institute in Chennai
digital marketing certification course in Chennai
digital marketing course training in Chennai
Digital Marketing course in Chennai with placement
digital marketing courses in chennai
The article was up to the point and described the information very effectively. Thanks to blog author for wonderful and informative post.
ReplyDeletewebsite development
very nice...
ReplyDeleteinplant training in chennai
inplant training in chennai
inplant training in chennai
brunei darussalam web hosting
costa rica web hosting
costa rica web hosting
hong kong web hosting
jordan web hosting
turkey web hosting
gibraltar web hosting
nice........
ReplyDeleteinplant training in chennai
inplant training in chennai
online python internship
online web design
online machine learning internship
online internet of things internship
online cloud computing internship
online Robotics
online penetration testing
good blogs.....!!!
ReplyDeletechile web hosting
colombia web hosting
croatia web hosting
cyprus web hosting
bahrain web hosting
india web hosting
iran web hosting
kazakhstan web hosting
korea web hosting
moldova web hosting
nice information....!!
ReplyDeletetext animation css
animation css background
sliding menu
hover css
css text animation
css loaders
dropdown menu
buttons with css
very good.....
ReplyDeleteinternship in bangalore for cse students
internship for aerospace engineering students in india
core companies in coimbatore for ece internship
paid internship in pune for computer engineering students
automobile internship in chennai
internship in chennai for eee with stipend
internship for bca students
dotnet training in chennai
aeronautical engineering internship
inplant training for ece students
good..nice..
ReplyDeleteinternships in bangalore for ece students 2019
internship for aeronautical engineering students in bangalore
kaashiv infotech chennai
internship for ece students in bangalore 2018
internship in chennai for eee with stipend
internship in chennai for mechanical engineering students
kaashiv infotech hyderabad
kaashiv infotech internship
internship in chennai for cse 2019
internship in aeronautical engineering
If your looking for Online Illinois license plate sticker renewals then you have need to come to the right place.We offer the fastest Illinois license plate sticker renewals in the state. organic ghee
ReplyDeleteThanks for sharing your innovative blog, it's more interesting.
ReplyDeletesalesforce course
best interview tips
professional courses after bsc
list of data analysis software
oracle interview questions for freshers
interview questions on pega
gret post agen sbobet88 online
ReplyDelete