{"action":"closed","issue":{"url":"https://api.github.com/repos/squaremo/amqp.node/issues/437","repository_url":"https://api.github.com/repos/squaremo/amqp.node","labels_url":"https://api.github.com/repos/squaremo/amqp.node/issues/437/labels{/name}","comments_url":"https://api.github.com/repos/squaremo/amqp.node/issues/437/comments","events_url":"https://api.github.com/repos/squaremo/amqp.node/issues/437/events","html_url":"https://github.com/squaremo/amqp.node/issues/437","id":335177055,"node_id":"MDU6SXNzdWUzMzUxNzcwNTU=","number":437,"title":"Add lib friendly interface","user":{"login":"aleixo","id":4128120,"node_id":"MDQ6VXNlcjQxMjgxMjA=","avatar_url":"https://avatars3.githubusercontent.com/u/4128120?v=4","gravatar_id":"","url":"https://api.github.com/users/aleixo","html_url":"https://github.com/aleixo","followers_url":"https://api.github.com/users/aleixo/followers","following_url":"https://api.github.com/users/aleixo/following{/other_user}","gists_url":"https://api.github.com/users/aleixo/gists{/gist_id}","starred_url":"https://api.github.com/users/aleixo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleixo/subscriptions","organizations_url":"https://api.github.com/users/aleixo/orgs","repos_url":"https://api.github.com/users/aleixo/repos","events_url":"https://api.github.com/users/aleixo/events{/privacy}","received_events_url":"https://api.github.com/users/aleixo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-06-24T12:53:29Z","updated_at":"2018-09-12T19:55:37Z","closed_at":"2018-09-12T19:55:37Z","author_association":"NONE","body":"Hi\r\n\r\nGreat lib by the way.\r\n\r\nI am using it so i made a small wrapper to it. My proposal is to extend your lib to allow users to use the wrapper.\r\n\r\nYou would consume from a queue like this (broker service is my wrapper)\r\n\r\n```\r\nconst brokerService = new BrokerService(brokerMasterConn, brokerSlaveConn);\r\nconst queueModel = new QueueModel(channel, type, configs);\r\nconst exchangeModel = new ExchangeModel(channel, type, configs);\r\nconst consumeModel = new ConsumeModel(queueModel, exchangeModel);\r\nbrokerService.consume(consumeModel, exchangeModel);\r\n```\r\n\r\nNot only it makes easier to use the lib and abstract, it also allows you to have fail-over mechanism.\r\nThe models would also be exposed by your lib and each constructor ir validating if you are passing one instance of those models.\r\n\r\nConfigs object is one json with the configurations (queue, exchange...)\r\n```\r\n\"VOICE\" : {\r\n        \"channel\" : \"VOICE\",\r\n        \"external\" : {            \r\n            \"exchange\" : {\r\n                \"name\" : \"external_exchange\",                \r\n                \"type\" : \"direct\"\r\n            },\r\n            \"queue\" : {                \r\n                \"name\" : \"external_voice\",\r\n                \"bindingKey\" : \"bind_external_voice\",\r\n                \"exclusive\" : false,\r\n                \"durable\" : true,\r\n                \"autoDelete\" : false\r\n            }\r\n        }, \r\n        \"out\" : {\r\n            \"exchange\" : {\r\n                \"name\" : \"out_exchange\",                \r\n                \"type\": \"direct\"\r\n            },\r\n            \"queue\" : {                                \r\n                \"name\" : \"out_voice\",\r\n                \"bindingKey\" : \"bind_out_voice\",  \r\n                \"exclusive\" : false,\r\n                \"durable\" : true,\r\n                \"autoDelete\" : false              \r\n            }\r\n\r\n        },\r\n        \"in\" : {\r\n            \"exchange\" : {\r\n                \"name\" : \"in_exchange\",                \r\n                \"type\": \"direct\"\r\n            },\r\n            \"queue\" : {                \r\n                \"name\" : \"in_voice\",\r\n                \"bindingKey\" : \"bind_in_voice\",\r\n                \"exclusive\" : false,\r\n                \"durable\" : true,\r\n                \"autoDelete\" : false      \r\n            }\r\n        }\r\n    },\r\n```\r\n\r\nThe point is, instead of creating my npm, your lib would become better than it is. Please tell me your thoughts."}}
{"actor":{"display_login":"cressie176"}}