When processing a restart request, the router sends a QUIT message to all existing processes of the application. Then, a new shared application port is created to ensure that new requests won't be handled by the old processes of the application.
11 lines
200 B
Python
11 lines
200 B
Python
import os
|
|
import time
|
|
|
|
time.sleep(2)
|
|
|
|
def application(environ, start_response):
|
|
body = str(os.getpid()).encode()
|
|
|
|
start_response('200', [('Content-Length', str(len(body)))])
|
|
return [body]
|