I checked this in on the examples branch.

------------------------------------------------------------------------
r1626029 | aconway | 2014-09-18 13:11:12 -0400 (Thu, 18 Sep 2014) | 7
lines

NO-JIRA: Added tutorial/sync_client.py to demonstrate a synchronous
request-response client.

This client uses the familiar paradigm of making blocking calls that
send a
request and return the response.

Made some improvements to BlockingThread error handling and timeouts.

------------------------------------------------------------------------

It needs a little work to be realistic (needs to check correlation ids
at least) but it is quite neat.

Most of the current tutorial examples are in an event driven style,
which is great for servers and intermediaries but less familiar on the
client side. This demo shows that you can also do traditional
client-driven request response quite easily. The error handling is
simple: invoke() throws if anything goes wrong.

I did this the hard way first - by writing my own raw event handlers. It
was instructive but, well, hard. Then I noticed Gordon's
BlockingConnection class already did everything I had figured out the
hard way (blocking and error handing) so I rewrote it using that and it
was very easy.

So far I think this is promising.

Cheers,
Alan.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to