Skip to content

Commit e415e03

Browse files
Merge pull request #64 from RethinkRobotics-opensource/fixServiceClientQueueing
Fix issue with service client call queuing
2 parents 97d808d + 4994125 commit e415e03

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib/ServiceClient.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ class ServiceClient extends EventEmitter {
137137
oldCall.reject(err);
138138
}
139139

140-
// if there weren't any other calls in the queue, execute this new call
140+
// if there weren't any other calls in the queue and there's no current call, execute this new call
141141
// otherwise new call will be handled in order when others complete
142-
if (this._callQueue.length === 1) {
142+
if (this._callQueue.length === 1 && this._currentCall === null) {
143143
this._executeCall();
144144
}
145145
});
@@ -212,7 +212,7 @@ class ServiceClient extends EventEmitter {
212212

213213
// connect to the service's tcpros server
214214
return this._connectToService(serviceHost, call);
215-
})
215+
});
216216
}
217217
else {
218218
// this is a persistent service that we've already set up

0 commit comments

Comments
 (0)