tcalmant / jsonrpclib

A Python (2 & 3) JSON-RPC over HTTP that mirrors the syntax of xmlrpclib (aka jsonrpclib-pelix)
https://jsonrpclib-pelix.readthedocs.io/
Apache License 2.0
53 stars 24 forks source link

Order of inherited classes in PooledJSONRPCServer definition #55

Closed tcalmant closed 2 years ago

tcalmant commented 2 years ago

Discussed in https://github.com/tcalmant/jsonrpclib/discussions/54

Originally posted by **RobiIhs** February 17, 2022 Hello, first of all, thanks for the library. I tried to use _PooledJSONRPCServer_ but it didn't seem to work as expected. Could it be because _socketserver.ThreadingMixIn_ should precede _SimpleJSONRPCServer_ in inheritance order? Then I created my own _ThreadedJSONRPCServer_ inheriting from _SimpleJSONRPCServer_ and _socketserver.ThreadingMixIn_ and I verified that _socketserver.ThreadingMixIn_ must come first to have multi-threaded behaviour. Roberto cfr.: https://docs.python.org/3/library/socketserver.html#:~:text=The%20mix%2Din%20class%20comes%20first%2C%20since%20it%20overrides%20a%20method%20defined%20in%20UDPServer.%20Setting%20the%20various%20attributes%20also%20changes%20the%20behavior%20of%20the%20underlying%20server%20mechanism.
tcalmant commented 2 years ago

Fixed in 2fded62b234896ceb359818ccb95aa9239a85595