rabbit.js icon indicating copy to clipboard operation
rabbit.js copied to clipboard

Modularizing sockets definition.

Open sydcanem opened this issue 11 years ago • 4 comments

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!

sydcanem avatar Jan 08 '15 08:01 sydcanem

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

squaremo avatar Jan 10 '15 21:01 squaremo

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);

sydcanem avatar Jan 11 '15 07:01 sydcanem

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

squaremo avatar Jan 11 '15 12:01 squaremo

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

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

sydcanem avatar Jan 12 '15 01:01 sydcanem