def handle_fs_request(self, queue):
"""
Handle incoming messages from :class:`FsClient` instances.
"""
msg, *args = queue.recv_pyobj()
try:
handler = {
'EXPECT': self.do_expect,
'VERIFY': self.do_verify,
'STATVFS': self.do_statvfs,
}[msg]
result = handler(*args)
except Exception as exc:
self.logger.error('error handling fs request: %s', msg)
queue.send_pyobj(['ERR', exc])
else:
queue.send_pyobj(['OK', result])
评论列表
文章目录