#NEWLINE# def _eventlet_serve( sock , handle , concurrency ) : #NEWLINE# #INDENT# '\n    Serve requests forever.\n\n    This code is nearly identical to ``eventlet.convenience.serve`` except\n    that it attempts to join the pool at the end, which allows for gunicorn\n    graceful shutdowns.\n    ' #NEWLINE# pool = eventlet . greenpool . GreenPool ( handle ) #NEWLINE# server_gt = eventlet . greenthread . getcurrent ( ) #NEWLINE# while True : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# ( conn , addr ) = sock . accept ( ) #NEWLINE# gt = pool . spawn ( handle , conn , addr ) #NEWLINE# gt . link ( _eventlet_stop , server_gt , conn ) #NEWLINE# ( conn , addr , gt ) = ( None , None , None ) #NEWLINE# #UNINDENT# except eventlet . StopServe : #NEWLINE# #INDENT# pool . waitall ( ) #NEWLINE# return