-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
Hello,
Firstly, the code worked very well, thank you for that. I have some problems. I'd appreciate it if you could help.
1. Problem - I want to get path at the process_request. Define two separate thread pools and i want to add requests to the thread pool by paths. I can get path, but the request is terminated. My sample code is below.
def __init__(self, nworkers, daemon=False, **threadpool_options):
self.running = True
assert nworkers > 0, "ThreadPoolMixIn servers must have at least one worker"
self.thread_pool = ThreadPool(
nworkers,
"ThreadPoolMixIn HTTP server on %s:%d"
% (self.server_name, self.server_port),
daemon,
**threadpool_options)
def process_request(self, request, client_address):
request.setblocking(1)
path = str(request.makefile('rb', -1).readline(65537), 'iso-8859-1').rstrip('\r\n').split()[1]
self.thread_pool.add_task(
lambda: self.process_request_in_thread(request, client_address))
2. Problem - I want to set different timeout value of request by paths.
Thanks
Metadata
Metadata
Assignees
Labels
No labels