From 8d11b3142471207c1dfbe7fb5fc39791551a370a Mon Sep 17 00:00:00 2001
From: 沈斌 <bluelazysb@hotmail.com>
Date: Thu, 22 Dec 2016 09:35:28 +0800
Subject: [PATCH] 环境数云服务端代码优化与整理

---
 queue.js |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/queue.js b/queue.js
index c377996..9ebd5ab 100644
--- a/queue.js
+++ b/queue.js
@@ -20,4 +20,17 @@
             //process.exit(0)
         }, 500);
     });
+};
+
+module.exports.pushToScreen = function(data) {
+    amqp.connect(uri, function(err, conn) {
+        conn.createChannel(function(err, ch) {
+            var _ex = 'ex_data_screen';
+            ch.assertExchange(_ex, 'fanout', { durable: false });
+            ch.publish(_ex, '', new Buffer(JSON.stringify(data)));
+        });
+        setTimeout(function() {
+            conn.close();
+        }, 500);
+    });
 };
\ No newline at end of file

--
Gitblit v1.8.0