8000 refactoring · sardesh/rabbitmq-tutorials@bf939e3 · GitHub
[go: up one dir, main page]

Skip to content

Commit bf939e3

Browse files
committed
refactoring
1 parent 16ecfe9 commit bf939e3

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

javascript-nodejs/src/receive_logs.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
#!/usr/bin/env node
22

33
var amqp = require('amqplib');
4-
54
var conn = amqp.connect('amqp://localhost')
6-
75
var ch = conn.then(createChannel).then(null, console.warn);
86

97
ch.then(function(ch) {
10-
var ok = ch.assertExchange('logs', 'fanout', {durable: false});
11-
ok = ok.then(function() {
8+
var x = ch.assertExchange('logs', 'fanout', {durable: false});
9+
var q = x.then(function() {
1210
return ch.assertQueue('', {exclusive: true});
1311
});
14-
ok = ok.then(function(qok) {
12+
13+
ok = q.then(function(qok) {
1514
return ch.bindQueue(qok.queue, 'logs', '').then(function() {
1615
return qok.queue;
1716
});

0 commit comments

Comments
 (0)
0