mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-10-26 12:10:44 +08:00
amqplib: callback-api definition and tests added
This commit is contained in:
1 parent
93bcd768f0
commit
9e7d9453a1
1 file changed
+2
-2
@@ -28,7 +28,7 @@ amqpcb.connect("amqp://localhost", (err, connection) => {
|
||||
if(!err) {
|
||||
connection.createChannel((err, channel) => {
|
||||
if (!err) {
|
||||
channel.assertQueue("myQueue", (err, ok) => {
|
||||
channel.assertQueue("myQueue", {}, (err, ok) => {
|
||||
if(!err) {
|
||||
channel.sendToQueue("myQueue", new Buffer(msg));
|
||||
}
|
||||
@@ -42,7 +42,7 @@ amqpcb.connect("amqp://localhost", (err, connection) => {
|
||||
if(!err) {
|
||||
connection.createChannel((err, channel) => {
|
||||
if (!err) {
|
||||
channel.assertQueue("myQueue", (err, ok) => {
|
||||
channel.assertQueue("myQueue", {}, (err, ok) => {
|
||||
if(!err) {
|
||||
channel.consume("myQueue", newMsg => console.log("New Message: " + newMsg.content.toString()));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user