From 86b8884f15b647ebc963cadff8502f2449ce04a2 Mon Sep 17 00:00:00 2001 From: Scott Gress Date: Tue, 1 Nov 2016 12:04:58 -0500 Subject: [PATCH] Officially remove firehose --- lib/hooks/pubsub/drink.js | 11 ----------- lib/hooks/pubsub/index.js | 35 ----------------------------------- lib/hooks/pubsub/spit.js | 11 ----------- lib/hooks/pubsub/squirt.js | 13 ------------- 4 files changed, 70 deletions(-) delete mode 100644 lib/hooks/pubsub/drink.js delete mode 100644 lib/hooks/pubsub/spit.js delete mode 100644 lib/hooks/pubsub/squirt.js diff --git a/lib/hooks/pubsub/drink.js b/lib/hooks/pubsub/drink.js deleted file mode 100644 index 7614d36d66..0000000000 --- a/lib/hooks/pubsub/drink.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Drink from the firehose. - */ - -module.exports = function (sails) { - - return function subscribeToFirehose (socket) { - sails.sockets.join( socket, 'sails_firehose' ); - }; - -}; diff --git a/lib/hooks/pubsub/index.js b/lib/hooks/pubsub/index.js index 8059fa4cad..e72db928b8 100644 --- a/lib/hooks/pubsub/index.js +++ b/lib/hooks/pubsub/index.js @@ -724,9 +724,6 @@ module.exports = function(sails) { // If a request object was sent, get its socket, otherwise assume a socket was sent. var socketToOmit = (req && req.socket ? req.socket : req); - // In development environment, blast out a message to everyone - sails.sockets.publishToFirehose(data); - data.verb = 'updated'; data.previous = options.previous; delete data.model; @@ -782,9 +779,6 @@ module.exports = function(sails) { // If a request object was sent, get its socket, otherwise assume a socket was sent. var socketToOmit = (req && req.socket ? req.socket : req); - // In development environment, blast out a message to everyone - sails.sockets.publishToFirehose(data); - data.verb = 'destroyed'; delete data.model; @@ -917,16 +911,6 @@ module.exports = function(sails) { // If a request object was sent, get its socket, otherwise assume a socket was sent. var socketToOmit = (req && req.socket ? req.socket : req); - - // In development environment, blast out a message to everyone - sails.sockets.publishToFirehose({ - id: id, - model: this.identity, - verb: 'addedTo', - attribute: alias, - addedId: idAdded - }); - this.publish(id, this.identity, 'add:'+alias, (function (){ var event = { id: id, @@ -1013,15 +997,6 @@ module.exports = function(sails) { // If a request object was sent, get its socket, otherwise assume a socket was sent. var socketToOmit = (req && req.socket ? req.socket : req); - // In development environment, blast out a message to everyone - sails.sockets.publishToFirehose({ - id: id, - model: this.identity, - verb: 'removedFrom', - attribute: alias, - removedId: idRemoved - }); - this.publish(id, this.identity, 'remove:' + alias, { id: id, verb: 'removedFrom', @@ -1215,16 +1190,6 @@ module.exports = function(sails) { // If a request object was sent, get its socket, otherwise assume a socket was sent. var socketToOmit = (req && req.socket ? req.socket : req); - // Blast success message - sails.sockets.publishToFirehose({ - - model: this.identity, - verb: 'create', - data: values, - id: values[this.primaryKey] - - }); - // Publish to classroom var payload = { verb: 'created', diff --git a/lib/hooks/pubsub/spit.js b/lib/hooks/pubsub/spit.js deleted file mode 100644 index 15bdaebd57..0000000000 --- a/lib/hooks/pubsub/spit.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Stop drinking from the firehose. - */ - -module.exports = function (sails) { - - return function unsubscribeFromFirehose ( socket ) { - sails.sockets.leave(socket, 'sails_firehose'); - }; - -}; diff --git a/lib/hooks/pubsub/squirt.js b/lib/hooks/pubsub/squirt.js deleted file mode 100644 index 7a278a3ee2..0000000000 --- a/lib/hooks/pubsub/squirt.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Squirt the firehose. - */ - -module.exports = function (sails) { - - return function publishToFirehose ( data ) { - if (sails.config.environment == 'development') { - sails.sockets.broadcast('sails_firehose', 'firehose', data); - } - }; - -};