+---------------------------------------------------------+
| WEB brower |
+---------------------------------------------------------+
| ^ ^ ^
| | | |
|HTTP request | | |
| | | |
-- +---V-----------------------------------------------------+
/ | HTTPServer | WSGI server
| | +-------------------+ put +-------------------+ |
| | |ThreadPool(Queue) <+-----+ HTTPConnection | |
| | |+---------------+ | | +---------------+ | |
| | ||WorkerThread | | | |HTTPRequest | | |
| | |+---------------+ | | +---------------+ | |
| | +-------------------+ +-------------------+ |
| +---------------------------------------------------------+
| /------------\ ^ ^ ^
| | environ | | | |
| \------------/ | | |
| .............|...................|.......|..........|.........WSGI
| | | | |
| +------V-------+ | | |
| | req | | | |
| +--------------+ | | |
Butterfly | | | |
| +------V-------+ | | |
| |apiname_getter| | | |
| +--------------+ | | |
| | | | |
| +--------V--------+ False +--+--+ | |
| |is_protocol_exist|------>| 400 | | |
| +-----------------+ +-----+ | |
| | | |
| | (protocol_process) | |
| V | |
| +-----------------+ | |
| | protocol | Exception +-----+ |
| | +-------------+ |---------------| 500 | |
| | |/app1/handler| | +-----+ |
| | |/app2/handler| | +----------------------------+
| | +-------------+ |---------------|httpstatus, headers, content|
\ +-----------------+ +----------------------------+
---