squaremo / rabbit.js

Messaging in Node.JS made easy using RabbitMQ
Other
1.52k stars 142 forks source link

Modularizing sockets definition. #87

Open sydcanem opened 9 years ago

sydcanem commented 9 years ago

Hi. Happy New Year! I'm creating an amqp top layer library and I would like to use your sockets definition. Basically, what I'm planning to do is to manage the amqp connection with reconnection feature when error, basic topology and rpc mechanism with TTL for callbacks. It would be great if I could just pull any of your sockets directly and just supply the required arguments and build the API on top of it. Would this be possible?

Thanks for the library. Cheers!

squaremo commented 9 years ago

I'm not quite sure what you're asking for -- can you sketch out how it would look? (In code, or pseudo-code, perhaps)

sydcanem commented 9 years ago

It would be great if I could just do:

var ReqSocket = require('rabbit.js').ReqSocket;
// Manage the connection and channel
...
var requester = new ReqSocket(channel, options);
squaremo commented 9 years ago

Ah, I see! OK, that is a worthy aim. Let me take a look at it ..

sydcanem commented 9 years ago

Looks like this PR #88 seems to work ok. I can now do:

var ReqSocket = require('rabbit.js').REQ;