spring-framework / org.springframework.web.servlet.mvc.method.annotation / ResponseBodyEmitter / onCompletion

onCompletion

open fun onCompletion(callback: Runnable): Unit

Register code to invoke when the async request completes. This method is called from a container thread when an async request completed for any reason including timeout and network error. This method is useful for detecting that a ResponseBodyEmitter instance is no longer usable.