(self)
Send any iterable data, then close self and the iterable

        Subclasses intended for use in asynchronous servers will
        want to redefine this method, such that it sets up callbacks
        in the event loop to iterate over the data, and to call
        'self.close()' once the response is finished.
Send any iterable data, then close self and the iterable
Send any iterable data then close self and the iterable
def finish_response(self):
        """Send any iterable data, then close self and the iterable

        Subclasses intended for use in asynchronous servers will
        want to redefine this method, such that it sets up callbacks
        in the event loop to iterate over the data, and to call
        'self.close()' once the response is finished.
        """
        try:
            if not self.result_is_file() or not self.sendfile():
                for data in self.result:
                    self.write(data)
                self.finish_content()
        except:
            # Call close() on the iterable returned by the WSGI application
            # in case of an exception.
            if hasattr(self.result, 'close'):
                self.result.close()
            raise
        else:
            # We only call close() when no exception is raised, because it
            # will set status, result, headers, and environ fields to None.
            # See bpo-29183 for more details.
            self.close()
def finish_response ( self ) : try : if not self . result_is_file ( ) or not self . sendfile ( ) : for data in self . result : self . write ( data ) self . finish_content ( ) except : # Call close() on the iterable returned by the WSGI application # in case of an exception. if hasattr ( self . result , 'close' ) : self . result . close ( ) raise else : # We only call close() when no exception is raised, because it # will set status, result, headers, and environ fields to None. # See bpo-29183 for more details. self . close ( )