Skip to content

Instantly share code, notes, and snippets.

@aenario
Last active August 29, 2015 14:25
Show Gist options
  • Save aenario/e4af843750dc608aaa4b to your computer and use it in GitHub Desktop.
Save aenario/e4af843750dc608aaa4b to your computer and use it in GitHub Desktop.
Sample
axon = require('axon');
// start axon's socket
socket = axon.socket('sub-emitter')
socket.connect(9105) // 9105 is the data-system axon port
socket.on('file.*', function(event, id){
// event is one of 'create', 'update', 'delete'
// id == id of the updated file
File.find(id, function(err, updatedFile){
// do anything with the file
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment