Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/cheroot/__pycache__/wsgi.cpython-39.pyc
Ðазад
a p�h�7 � @ s� d Z ddlZddlmZ ddlmZ ddlmZmZ G dd� dej �Z G d d � d ej�ZG dd� de�ZG d d� de�Z e�� ZG dd� d�Ze� je ee eed� dS )a� This class holds Cheroot WSGI server implementation. Simplest example on how to use this server:: from cheroot import wsgi def my_crazy_app(environ, start_response): status = '200 OK' response_headers = [('Content-type','text/plain')] start_response(status, response_headers) return [b'Hello world!'] addr = '0.0.0.0', 8070 server = wsgi.Server(addr, my_crazy_app) server.start() The Cheroot WSGI server can serve as many WSGI applications as you want in one instance by using a PathInfoDispatcher:: path_map = { '/': my_crazy_app, '/blog': my_blog_app, } d = wsgi.PathInfoDispatcher(path_map) server = wsgi.Server(addr, d) � N� )�server)� threadpool)�ntob�btonc s@ e Zd ZdZdZd � fdd � Zed d� �Zejdd� �Z� Z S )�Serverz8A subclass of HTTPServer which calls a WSGI application.�r r � N���� Fc sX t t| �j|t| j |||| d� || _|| _|| _|| _t j | |pFd|| | d�| _dS )a� Initialize WSGI Server instance. Args: bind_addr (tuple): network interface to listen to wsgi_app (callable): WSGI application callable numthreads (int): number of threads for WSGI thread pool server_name (str): web server name to be advertised via Server HTTP header max (int): maximum number of worker threads request_queue_size (int): the 'backlog' arg to socket.listen(); max queued connections timeout (int): the timeout in seconds for accepted connections shutdown_timeout (int): the total time, in seconds, to wait for worker threads to cleanly exit accepted_queue_size (int): maximum number of active requests in queue accepted_queue_timeout (int): timeout for putting request into queue )Zgateway�server_name�peercreds_enabled�peercreds_resolve_enabled� reuse_portr )�min�max�accepted_queue_size�accepted_queue_timeoutN)�superr �__init__� wsgi_gateways�wsgi_version�wsgi_app�request_queue_size�timeout�shutdown_timeoutr Z ThreadPool�requests)�self� bind_addrr � numthreadsr r r r r r r r r r �� __class__� �|/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/cheroot/wsgi.pyr ) s"