Is there any way to wrap a WSGI application method such the server will send a response when a particular method is called, rather than when the application method returns a sequence?
Basically, I'd like to have the equivalent of a finish_response(responseValue)
method.
WSGI app must return an iterable, one way or another. If you want to send partial responses, turn your application into a generator (or return an iterator):