Is there any hook for Python iterator?
I’m working on LLM with stream mode. I want to make my HTTP to reply 503 while the streaming of response is still typing answers (using Iterator).
I’m imagining something like:
controller.busy = true
iter = answer_questions(request_text) # Iterator
iter.on_close(lambda x: controller.busy = false)