Piotr Kliczewski has posted comments on this change.

Change subject: stomp: standalone client
......................................................................


Patch Set 2:

(5 comments)

https://gerrit.ovirt.org/#/c/42850/2//COMMIT_MSG
Commit Message:

Line 5: CommitDate: 2015-07-02 11:36:03 +0200
Line 6: 
Line 7: stomp: standalone client
Line 8: 
Line 9: Convinience method to create stomp client by providing information
> Convenience ?
Done
Line 10: needed to connect like hostname, port, queue names that we want to use
Line 11: and optional ssl context.
Line 12: 
Line 13: The client can send and receive messages and notifications.


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
Line 16: so it is important to close the client once it is not needed.
> what does clone mean ? can you write an example for the usage?
There is "close". Will provide usage example.
Line 17: 
Line 18: Change-Id: I8af6272679e115cf8eb80a14227476b59812581c


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
Line 16: so it is important to close the client once it is not needed.
Line 17: 
> explain that we plan to use it in external services to vdsm and the jsoncli
Done
Line 18: Change-Id: I8af6272679e115cf8eb80a14227476b59812581c


https://gerrit.ovirt.org/#/c/42850/2/lib/yajsonrpc/__init__.py
File lib/yajsonrpc/__init__.py:

Line 336:             raise JsonRpcError(response.error['code'],
Line 337:                                response.error['message'])
Line 338: 
Line 339:         return response.result
Line 340: 
> is this related??
It is. It helps to simply code when we use the client. It is a bug fix because 
there can be situations when we do not receive response due to timeout and this 
code breaks.
Line 341:     def call(self, *reqs, **kwargs):
Line 342:         call = self.call_async(*reqs)
Line 343:         call.wait(kwargs.get('timeout', CALL_TIMEOUT))
Line 344:         return call.responses


https://gerrit.ovirt.org/#/c/42850/2/lib/yajsonrpc/stompreactor.py
File lib/yajsonrpc/stompreactor.py:

Line 564:             client.subscribe(response_queue, sub_id=str(uuid4())),
Line 565:             request_queue,
Line 566:             client)
Line 567:     )
Line 568: 
> closing the client instance will stop the reactor thread?
Yes. Closing the client stops the thread.

I think that events and regular messages should be available from single client 
abstraction. I think that you ask for synchronous client which we should not 
expose/have. We can have asynchronous client with forced synchronicity if 
needed.
Line 569: 
Line 570: def StompRpcServer(bridge, stomp_client, request_queue, address, 
timeout):
Line 571:     server = JsonRpcServer(bridge, timeout)
Line 572: 


-- 
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: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <[email protected]>
Gerrit-Reviewer: Adam Litke <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Francesco Romani <[email protected]>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: Piotr Kliczewski <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: Yeela Kaplan <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to