Commit 45db6fcc20b66e04a4879ff1dee5fb13df1cc8d3
minro nits
Signed-off-by: wanderer <mjbecze@gmail.com>wanderer committed on 8/18/2017, 4:33:59 PM
Parent: 66df0eab8d15d49d023146aa317bc8ed5a517cd1
Files changed
portManager.js | changed |
portManager.js | ||
---|---|---|
@@ -137,17 +137,17 @@ | ||
137 | 137 | |
138 | 138 | message._fromPort = port |
139 | 139 | message.fromName = name |
140 | 140 | |
141 | - if (port.messages.push(message) === 1) { | |
141 | + const numOfMsg = port.messages.push(message) | |
142 | + | |
143 | + if (numOfMsg === 1) { | |
142 | 144 | if (this._isSaturated()) { |
143 | 145 | this._saturationResolve() |
144 | 146 | this._saturationPromise = new Promise((resolve, reject) => { |
145 | 147 | this._saturationResolve = resolve |
146 | 148 | }) |
147 | - } | |
148 | - | |
149 | - if (message._fromTicks < this._messageTickThreshold) { | |
149 | + } else if (message._fromTicks < this._messageTickThreshold) { | |
150 | 150 | this._oldestMessageResolve(message) |
151 | 151 | this._oldestMessagePromise = new Promise((resolve, reject) => { |
152 | 152 | this._oldestMessageResolve = resolve |
153 | 153 | }) |
@@ -185,12 +185,8 @@ | ||
185 | 185 | return port.messages[0] |
186 | 186 | } |
187 | 187 | } |
188 | 188 | |
189 | - waitOnPort (port, timeout) { | |
190 | - | |
191 | - } | |
192 | - | |
193 | 189 | /** |
194 | 190 | * Waits for the the next message if any |
195 | 191 | * @returns {Promise} |
196 | 192 | */ |
Built with git-ssb-web