|
1 | | -/*! angular-vertxbus - v2.0.2 - 2015-06-15 |
| 1 | +/*! angular-vertxbus - v2.0.3 - 2015-06-22 |
2 | 2 | * http://github.com/knalli/angular-vertxbus |
3 | 3 | * Copyright (c) 2015 Jan Philipp; Licensed MIT */ |
4 | 4 | (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ |
@@ -615,13 +615,19 @@ var LiveDelegate = (function (_BaseDelegate) { |
615 | 615 |
|
616 | 616 | // internal |
617 | 617 | value: function onEventbusOpen() { |
| 618 | + var connectionStateFlipped = false; |
618 | 619 | this.getConnectionState(true); |
619 | 620 | if (!this.states.connected) { |
620 | 621 | this.states.connected = true; |
621 | | - this.$rootScope.$broadcast('' + this.options.prefix + 'system.connected'); |
| 622 | + connectionStateFlipped = true; |
622 | 623 | } |
| 624 | + // Ensure all events will be re-attached |
623 | 625 | this.afterEventbusConnected(); |
624 | | - this.$rootScope.$digest(); |
| 626 | + // Everything is online and registered again, let's notify everybody |
| 627 | + if (connectionStateFlipped) { |
| 628 | + this.$rootScope.$broadcast('' + this.options.prefix + 'system.connected'); |
| 629 | + } |
| 630 | + this.$rootScope.$digest(); // explicitly |
625 | 631 | // consume message queue? |
626 | 632 | if (this.options.messageBuffer && this.messageQueue.size()) { |
627 | 633 | while (this.messageQueue.size()) { |
@@ -718,6 +724,7 @@ var LiveDelegate = (function (_BaseDelegate) { |
718 | 724 | } |
719 | 725 | if (this.options.debugEnabled) { |
720 | 726 | this.$log.debug('[Vert.x EB Service] Register handler for ' + address); |
| 727 | + console.trace(); |
721 | 728 | } |
722 | 729 | var callbackWrapper = function callbackWrapper(message, replyTo) { |
723 | 730 | callback(message, replyTo); |
@@ -1323,7 +1330,7 @@ var EventbusWrapper = (function (_BaseWrapper) { |
1323 | 1330 | _this.disconnectTimeoutEnabled = true; |
1324 | 1331 | _this.connect(); |
1325 | 1332 | } else if (_this.options.reconnectEnabled) { |
1326 | | - // automatical reconnect after timeout |
| 1333 | + // automatic reconnect after timeout |
1327 | 1334 | if (_this.options.debugEnabled) { |
1328 | 1335 | _this.$log.debug('[Vert.x EB Stub] Reconnect in ' + _this.options.sockjsReconnectInterval + 'ms'); |
1329 | 1336 | } |
|
0 commit comments