Closed roboguy222 closed 7 years ago
I ran into this with the MKS PDR2000's a while ago, is it the same problem? I fixed it with deferred locking:
def rw_line(self, code):
# Don't allow two concurrent read/write calls.
self._lock = DeferredLock()
return self._lock.run(partial(self._rw_line, code))
@inlineCallbacks
def _rw_line(self, code):
'''Write data to the device.'''
yield self.server.write_line(code, context=self.ctx)
time.sleep(0.2)
ans = yield self.server.read(context=self.ctx)
returnValue(ans)
I think, since the adr server does not use any contexts passed down from other clients, it creates its own context, and this should not actually be a problem. Closing issue.
If we call methods like
stopCompressor,
we don't use the same context for all requests from that adr device.