Skip to content

Instantly share code, notes, and snippets.

@wwhurley
Created November 16, 2012 21:22
Show Gist options
  • Save wwhurley/4091037 to your computer and use it in GitHub Desktop.
Save wwhurley/4091037 to your computer and use it in GitHub Desktop.
DerbyJS model manipulation
var model = store.createModel();
// Creation of AMQP connection, exchange and queue
model.subscribe('messages', function(err, messages) {
model.on('set', 'messages.*', function(id, message) {
exchange.publish('collector', message);
});
queue.subscribe(function (message, headers, deliveryInfo) {
model.set('messages.' + message.id, message);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment