Mutlithreading

A WSGI server that does threading.

ThreadingWSGIServer

A WSGI server that does threading. This class is identical to WSGIServer but handle each request in a new thread using the ThreadingMixIn. This is useful to handle web browsers pre-opening sockets, on which Server would wait indefinitely.

from sl.server import make_server, ThreadingWSGIServer
make_server("localhost", 8080, demo_app, ThreadingWSGIServer)

open http://localhost:8080 and see

you can do many requests to server.

WSGIServer handles one by one

ThreadingWSGIServer handles all at once asynchronously.

Last updated