Skip to content

Instantly share code, notes, and snippets.

@terrancesnyder
Created October 23, 2012 18:31
Show Gist options
  • Save terrancesnyder/3940595 to your computer and use it in GitHub Desktop.
Save terrancesnyder/3940595 to your computer and use it in GitHub Desktop.
Example of subscriber to infrastructure services
var cloudfront = require('./cloudfront.io');
var infrastructure = new cloudfront.infrastructure();
infrastructure.discover('memcache')
.enter(function(instance, done) {
// do something when a new memcache instance joins
done(); // callback required for ATOMIC acknowledgement (same concept as QUnit)
})
.exit(function(instance, done) {
// do something when an instance has leaves
done(); // callback required for ATOMIC acknowledgement (same concept as QUnit)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment