Manual acquire()/release() of semaphore does not limit number of
concurrent requests when combined with explicit yield. Fix this by using
semaphore.run() and removing inilineCallbacks decorator.
Change-Id: I47b8b9f5b726ca0905bb7c023d63b325c7f7d85f
Related: SYS#4399
d.addCallback(collect,partial(handle_reply,self.transport.write,self.factory.log))# treq's collect helper is handy to get all reply content at once
d.addErrback(lambdae,bsc:self.factory.log.critical("HTTP POST error %s while trying to register BSC %s on %s"%(e,bsc,self.factory.location)),bsc)# handle HTTP errors
# Ensure that we run only limited number of requests in parallel:
yieldself.factory.semaphore.acquire()
yieldd# we end up here only if semaphore is available which means it's ok to fire the request without exceeding the limit