Yaniv Bronhaim has posted comments on this change. Change subject: stomp: standalone client ......................................................................
Patch Set 6: Code-Review+1 (4 comments) https://gerrit.ovirt.org/#/c/42850/6//COMMIT_MSG Commit Message: Line 11: and optional ssl context. Line 12: Line 13: The client can send and receive messages and notifications. Line 14: JsonRpcClient can work in both synchronous and asynchronous way and it Line 15: uses an instance of Reactor to process I/O. Reactor is run in a thread Reactor runs Line 16: so it is important to close the client once it is not needed. Line 17: Line 18: Standalone client is designed to exchange data with vdsm for external Line 19: services and jsonrpc based vdscli. Line 38: def callback(client, event, params): Line 39: pass Line 40: Line 41: client.registerEventCallback(callback) Line 42: don't we want to have callback function for each request? Line 43: # It is important to close the client which stops the I/0 thread if not Line 44: # managed by context manager Line 45: client.close() Line 46: https://gerrit.ovirt.org/#/c/42850/6/lib/yajsonrpc/__init__.py File lib/yajsonrpc/__init__.py: Line 434: Line 435: def close(self): Line 436: self._transport.close() Line 437: Line 438: stop = close I prefer to see two functions doing the same.. Line 439: Line 440: def registerEventCallback(self, eventcb): Line 441: self._eventcbs.append(ref(eventcb)) Line 442: https://gerrit.ovirt.org/#/c/42850/6/lib/yajsonrpc/stompreactor.py File lib/yajsonrpc/stompreactor.py: Line 547: """ Line 548: Returns JsonRpcClient able to receive jsonrpc messages and notifications. Line 549: It is required to provide host and port where we want to connect and Line 550: request and response queues that we want to use during communication. Line 551: We can provide ssl context if we want to secure connection. I'd explain what lazy_start=False will do Line 552: """ Line 553: reactor = Reactor() Line 554: Line 555: def start(): -- To view, visit https://gerrit.ovirt.org/42850 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8af6272679e115cf8eb80a14227476b59812581c Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Piotr Kliczewski <piotr.kliczew...@gmail.com> Gerrit-Reviewer: Adam Litke <ali...@redhat.com> Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com> Gerrit-Reviewer: Francesco Romani <from...@redhat.com> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com> Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczew...@gmail.com> Gerrit-Reviewer: Yaniv Bronhaim <ybron...@redhat.com> Gerrit-Reviewer: Yeela Kaplan <ykap...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches