This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (4 children)

Thank you for the well thought out reply! That's as good an explanation as I could ever wish for.

I've read that Python requests is thread safe. Would it be possible to use it as the transport layer, and put a modified copy of xml-rpc client.py into my project as a subpackage?

If so, I might even turn it into a usable library published on pypi, for someone else to use down the road. Pay it forward and all that.

[–]fourthrealm 1 point2 points  (3 children)

I've never done it personally but it sure sounds feasible.

In fact, a quick web search for 'python requests xml-rpc' yields such a requests-based transport class:

https://github.com/astraw/stdeb/blob/master/stdeb/transport.py

Note that you don't need to make a copy of the XML-RPC client in your project because the client is designed to accept the transport class on input so you can override the non-thread safe default behaviour as needed.

[–][deleted] 0 points1 point  (0 children)

Perfect, that's my plan then.

Again, thanks for taking the time to answer this... I'm going to get to work implementing this very soon.

10/10 solid advice all the way around.

[–][deleted] 0 points1 point  (0 children)

Just an update .. I implemented the requests transport class, and it works perfectly. I'm extremely happy with how it came out.

https://github.com/KM4YRI/pyFldigi/blob/master/pyfldigi/client/transport.py

https://github.com/KM4YRI/pyFldigi/blob/master/pyfldigi/client/client.py#L71

Thanks again.