Hi,
I believe your handler will be called once per http chunk when using chunked encoding (which should be your default in most use cases). If you're not using chunked encoding, your code will most likely be called per nginx buffer in the output buffer chain.
So, to answer your last question - you SHOULD NOT assume you'll have the entire response body when you're called (but it could be the case for smaller response bodies or if your buffer size is big enough)
Best of luck,
-Itamar