mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
Remoed alot of code before starting to add more. Trimmed as much as possible to get to the point that I understood what was going on in each place. Split the server code into multiple objects to help my sanity. Arbiter is now the main class in the master process that keeps track of child processes and so on and such forth. The Worker class is responsible for handling incoming requests from the server socket passed to its constructor.
16 lines
392 B
Python
16 lines
392 B
Python
|
|
from gunicorn.httpserver import WSGIServer
|
|
|
|
|
|
|
|
|
|
def simple_app(environ, start_response):
|
|
"""Simplest possible application object"""
|
|
status = '200 OK'
|
|
response_headers = [('Content-type','text/plain')]
|
|
start_response(status, response_headers)
|
|
return ['Hello world!\n']
|
|
|
|
if __name__ == '__main__':
|
|
server = WSGIServer(("127.0.0.1", 8000), 1, simple_app)
|
|
server.run() |