Skip to content

RonRothman/mtwsgi

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

mtwsgi

Multithreaded Python WSGI implementation.

Drop-in replacement for wsgiref.WSGIServer, but dispatches requests to threads in a pool instead of serving requests serially (blocking).

Can be used indepently of Bottle, but here's an example that uses both:

import bottle
import time
from mtbottle import MTServer

app = bottle.Bottle()

@app.route('/')
def foo():
    time.sleep(2)
    return 'hello, world!\n'

app.run(server=MTServer, host='0.0.0.0', port=8080, thread_count=3)

# Here, app is nonblocking; it will handle up to 3 requests concurrently.
# A 4th concurrent request would block until one of the first 3 completed.

About

A Multithreaded Python WSGI Implementation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages