close

suspend fun close(timeout: Duration)

Refuses new requests from now on (FrameworkCodes.NODE_CLOSING), waits for the admissions under way and the detached commands accepted before, together at most timeout (the node's drain timeout), and closes their scope.

An admission ends by its own send's deadline once admitted (min(plan, wait.maxTimeout)), but the application's plugins it runs first and a detached command's run (its execution or forward) are bounded by nothing of the gateway's. At timeout, the detached commands still running are cancelled with the scope, and an admission still under way is refused (FrameworkCodes.NODE_CLOSING) once its plugins return: nothing of it is launched or sent.