开发者

Python - BaseHTTPServer.HTTPServer Concurrency & Threading

开发者 https://www.devze.com 2022-12-22 08:57 出处:网络
I开发者_JAVA百科s there a way to make BaseHTTPServer.HTTPServer be multi-threaded like SocketServer.ThreadingTCPServer?You can simply use the threading mixin using both of those classes to make it mul

I开发者_JAVA百科s there a way to make BaseHTTPServer.HTTPServer be multi-threaded like SocketServer.ThreadingTCPServer?


You can simply use the threading mixin using both of those classes to make it multithread :)

It won't help you much in performance though, but it's atleast multithreaded.

from SocketServer import ThreadingMixIn
from BaseHTTPServer import HTTPServer

class MultiThreadedHTTPServer(ThreadingMixIn, HTTPServer):
    pass
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号