Skip to content

Instantly share code, notes, and snippets.

@tedkulp
Created June 11, 2014 21:48
Show Gist options
  • Save tedkulp/e3bebcd7c4c8e7c02a0a to your computer and use it in GitHub Desktop.
Save tedkulp/e3bebcd7c4c8e7c02a0a to your computer and use it in GitHub Desktop.
_ = require('lodash')
rpc = require('amqp-rpc').factory
url: "amqp://admin:changeme@192.168.100.10:5672"
exchange: "rpc_exchange"
rpc.on 'echo.*', (params, cb, callInfo) ->
if params.message
reply = {
echo: true
message: params.message
}
_.delay ->
cb(reply)
, 10000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment