Changeset View
Changeset View
Standalone View
Standalone View
support/aphlict/server/lib/AphlictListenerList.js
| Show All 36 Lines | getListeners: function() { | ||||
| for (var i = 0; i < keys.length; i++) { | for (var i = 0; i < keys.length; i++) { | ||||
| listeners.push(this._listeners[keys[i]]); | listeners.push(this._listeners[keys[i]]); | ||||
| } | } | ||||
| return listeners; | return listeners; | ||||
| }, | }, | ||||
| getActiveListenerCount: function() { | getActiveListenerCount: function() { | ||||
| return this._listeners.length; | return Object.keys(this._listeners).length; | ||||
| }, | }, | ||||
| getTotalListenerCount: function() { | getTotalListenerCount: function() { | ||||
| return this._totalListenerCount; | return this._totalListenerCount; | ||||
| }, | }, | ||||
| _generateNextID: function() { | _generateNextID: function() { | ||||
| do { | do { | ||||
| this._nextID = (this._nextID + 1) % 1000000000000; | this._nextID = (this._nextID + 1) % 1000000000000; | ||||
| } while (this._nextID in this._listeners); | } while (this._nextID in this._listeners); | ||||
| return this._nextID; | return this._nextID; | ||||
| }, | }, | ||||
| }, | }, | ||||
| }); | }); | ||||