bjoernHTTP/1.1 WSGI 服務器
bjoern 是個快速、超輕量級的 HTTP/1.1 WSGI 服務器軟件,為 CPython 編寫。使用 C 語言開發(fā),基于 Libev 事件庫和 http-parser 開發(fā),這是一個單線程的服務,占用內(nèi)存非常低。
示例代碼:
# Bind to TCP host/port pair: bjoern.run(wsgi_application, host, port) # TCP host/port pair, enabling SO_REUSEPORT if available. bjoern.run(wsgi_application, host, port, reuseport=True) # Bind to Unix socket: bjoern.run(wsgi_application, 'unix:/path/to/socket') # Bind to abstract Unix socket: (Linux only) bjoern.run(wsgi_application, 'unix:@socket_name') bjoern.listen(wsgi_application, host, port) bjoern.run()
評論
圖片
表情
