Skip to content
This repository has been archived by the owner on Jun 14, 2019. It is now read-only.

Commit

Permalink
Release 0.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
knalli committed Dec 18, 2014
1 parent 32e378b commit 0a48288
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 21 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
<a name="0.11.0"></a>
## 0.11.0 (2014-12-18)


#### Features

* replace console w/ $log ([3c9be73c](http://github.com/knalli/angular-vertxbus/commit/3c9be73c7d41f22b4b46a0dbf17880063bddf7a9))
* **service:** improve memory usage, remove empty arrays of handlers ([4b680026](http://github.com/knalli/angular-vertxbus/commit/4b68002622ac7390584596a4ef0ef1e34088a9b5))


<a name="0.10.0"></a>
## 0.10.0 (2014-12-14)

Expand Down
26 changes: 16 additions & 10 deletions dist/angular-vertxbus.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! angular-vertxbus - v0.10.0 - 2014-12-14
/*! angular-vertxbus - v0.11.0 - 2014-12-18
* http://github.com/knalli/angular-vertxbus
* Copyright (c) 2014 ; Licensed */
(function() {
Expand Down Expand Up @@ -139,30 +139,30 @@
Furthermore, the stub supports theses extra APIs:
- recconnect()
*/
this.$get = ['$timeout', function($timeout) {
this.$get = ['$timeout', '$log', function($timeout, $log) {
var EventBusOriginal, EventBusStub, connect, debugEnabled, enabled, eventBus, prefix, reconnectEnabled, sockjsOptions, sockjsReconnectInterval, sockjsStateInterval, url, urlPath, urlServer, _ref;
_ref = angular.extend({}, DEFAULT_OPTIONS, options), enabled = _ref.enabled, debugEnabled = _ref.debugEnabled, prefix = _ref.prefix, urlServer = _ref.urlServer, urlPath = _ref.urlPath, reconnectEnabled = _ref.reconnectEnabled, sockjsStateInterval = _ref.sockjsStateInterval, sockjsReconnectInterval = _ref.sockjsReconnectInterval, sockjsOptions = _ref.sockjsOptions;
EventBusStub = null;
EventBusOriginal = typeof vertx !== "undefined" && vertx !== null ? vertx.EventBus : void 0;
if (enabled && EventBusOriginal) {
url = "" + urlServer + urlPath;
if (debugEnabled) {
console.debug("[Vert.x EB Stub] Enabled: connecting '" + url + "'");
$log.debug("[Vert.x EB Stub] Enabled: connecting '" + url + "'");
}
eventBus = null;
connect = function() {
eventBus = new EventBusOriginal(url, void 0, sockjsOptions);
eventBus.onopen = function() {
if (debugEnabled) {
console.debug("[Vert.x EB Stub] Connected");
$log.debug("[Vert.x EB Stub] Connected");
}
if (typeof EventBusStub.onopen === 'function') {
EventBusStub.onopen();
}
};
eventBus.onclose = function() {
if (debugEnabled) {
console.debug("[Vert.x EB Stub] Reconnect in " + sockjsReconnectInterval + "ms");
$log.debug("[Vert.x EB Stub] Reconnect in " + sockjsReconnectInterval + "ms");
}
if (typeof EventBusStub.onclose === 'function') {
EventBusStub.onclose();
Expand Down Expand Up @@ -224,7 +224,7 @@
EventBusStub.getOptions.displayName = "" + CONSTANTS.MODULE + "/" + CONSTANTS.COMPONENT + ": EventBusStub.getOptions";
} else {
if (debugEnabled) {
console.debug("[Vert.x EB Stub] Disabled");
$log.debug("[Vert.x EB Stub] Disabled");
}
}
return EventBusStub;
Expand Down Expand Up @@ -419,7 +419,7 @@
return this;
};
this.skipUnauthorizeds.displayName = "" + CONSTANTS.MODULE + "/" + CONSTANTS.COMPONENT + ": provider.skipUnauthorizeds";
this.$get = ['$rootScope', '$q', '$interval', '$timeout', 'vertxEventBus', function($rootScope, $q, $interval, $timeout, vertxEventBus) {
this.$get = ['$rootScope', '$q', '$interval', '$timeout', 'vertxEventBus', '$log', function($rootScope, $q, $interval, $timeout, vertxEventBus, $log) {
var connectionIntervalCheck, connectionState, debugEnabled, deconstructors, enabled, ensureOpenAuthConnection, ensureOpenConnection, loginPromise, messageBuffer, messageQueue, prefix, reconnectEnabled, sockjsOptions, sockjsReconnectInterval, sockjsStateInterval, urlPath, urlServer, util, validSession, wrapped, _ref, _ref1;
_ref = (vertxEventBus != null ? vertxEventBus.getOptions() : void 0) || {}, enabled = _ref.enabled, debugEnabled = _ref.debugEnabled, prefix = _ref.prefix, urlServer = _ref.urlServer, urlPath = _ref.urlPath, reconnectEnabled = _ref.reconnectEnabled, sockjsStateInterval = _ref.sockjsStateInterval, sockjsReconnectInterval = _ref.sockjsReconnectInterval, sockjsOptions = _ref.sockjsOptions, messageBuffer = _ref.messageBuffer;
connectionState = vertxEventBus != null ? (_ref1 = vertxEventBus.EventBus) != null ? _ref1.CLOSED : void 0 : void 0;
Expand Down Expand Up @@ -480,7 +480,7 @@
return true;
} else {
if (debugEnabled) {
console.debug("[Vert.x EB Service] Message was not sent because login is required");
$log.debug("[Vert.x EB Service] Message was not sent because login is required");
}
return false;
}
Expand All @@ -497,7 +497,7 @@
return;
}
if (debugEnabled) {
console.debug("[Vert.x EB Service] Register handler for " + address);
$log.debug("[Vert.x EB Service] Register handler for " + address);
}
if (deconstructors.containsKey(callback)) {
return deconstructors.get(callback);
Expand All @@ -515,7 +515,7 @@
return;
}
if (debugEnabled) {
console.debug("[Vert.x EB Service] Unregister handler for " + address);
$log.debug("[Vert.x EB Service] Unregister handler for " + address);
}
vertxEventBus.unregisterHandler(address, deconstructors.get(callback));
deconstructors.remove(callback);
Expand Down Expand Up @@ -611,6 +611,9 @@
wrapped.handlers[address].splice(index, 1);
}
}
if (wrapped.handlers[address].length < 1) {
wrapped.handlers[address] = void 0;
}
};
deconstructor.displayName = "" + CONSTANTS.MODULE + "/" + CONSTANTS.COMPONENT + ": wrapped.registerHandler (deconstructor)";
return deconstructor;
Expand All @@ -623,6 +626,9 @@
wrapped.handlers[address].splice(index, 1);
}
}
if (wrapped.handlers[address].length < 1) {
wrapped.handlers[address] = void 0;
}
if (connectionState === vertxEventBus.EventBus.OPEN) {
return util.unregisterHandler(address, callback);
}
Expand Down
Loading

0 comments on commit 0a48288

Please sign in to comment.