endpoints
endpoints copied to clipboard
endpoints client server is needlessly complex
The wsgi clients use a subprocess and thread to run the server using the endpoints.__main__ module, this seems excessive, why not just run it in a thread locally? I think that would be simpler and easier, the uwsgi makes a bit more sense since it runs uwsgi, but even there, it might be worth looking at the new testdata.command stuff that uses subprocess and threading since that codes is newer and conceptually simpler
the reason the server clients use a subprocess is for things like uwsgi which is ran outside of python, and it's just easier to make them all use subprocess, even if they just call python -m endpoints to keep it consistent.
It would be worth going through the subprocess code and updating it to testdata's standard though since that is the best subprocess code I've got right now. I actually removed the client code from captain recently because it wasn't worth having testdata like code in 2 places, but I think endpoints is different since each server needs to be customized and so trying to wrap testdata would result in almost the same amount of code anyway