Nir Soffer has posted comments on this change.
Change subject: json-rpc: Protocol detection ......................................................................
Patch Set 22:
(1 comment)
http://gerrit.ovirt.org/#/c/26300/22/vdsm/protocolDetector.py File vdsm/protocolDetector.py:
Line 88: finally: Line 89: for handler in self._handlers: Line 90: handler.stop() Line 91: Line 92: self._json_binding.stop()
There is big difference between xml and json bindings. XML is used only by
It seems that this class could not care less about the bindings, and is interested in detectors (unless I don't understand the design).
So a possible way to configure this class is:
json_bindings = JSONBindings(...) protocl_detector.add_detector(STOMPDetector(json_bindings)) protocl_detector.add_detecto(AMQPDetector(json_bindings))
xml_bindings = XMLBindings(...) protocol_dectector.add_detector(XMLDetector(xml_bindings))
http_bindings = HTTPBindings(...) protocol_dectector.add_detector(HTTPDetector(http_bindings))
Then when application is fully configured, start everything:
json_binding.start() xml_binding.start() http_binding.start() protocol_detector.start()
And shut down when application is terminating:
protocol_detector.stop() http_binding.start() xml_binding.stop() json_binding.stop()
Can this work? Line 93: self._poller.unregister(self._socket) Line 94: self._poller.unregister(self._read_fd) Line 95: self._socket.close() Line 96: