<@U0RM4EPC7> SuspendApp-Ktor currently handles the...
# arrow-contributors
p
@simon.vergauwen SuspendApp-Ktor currently handles the preWait delay (to allow load balancers time to react). should this be something configurable on the
SuspendApp
scope itself to delay the entire scope from being cancelled? We've noticed in a service that has two distinct Ktor embedded servers that the pre-wait occurs once for each service. Obviously we can disable it for the first server and use the last-registered (and first-released) server to apply the pre-wait, but it feels like it belongs a level above.
s
> We've noticed in a service that has two distinct Ktor embedded servers that the pre-wait occurs once for each service. Obviously we can disable it for the first server and use the last-registered (and first-released) server to apply the pre-wait, but it feels like it belongs a level above. Right, because the finalisers run sequentially. I didn't feel it really belonged on the top-level, since it can be composed quite easily. In this case I would disable the prewait, or move it somewhere else explicitly.
Copy code
suspend fun ResourceScope.prewait(): Unit = install({}) { delay(prewait) }
A
ResourceScope.parInstall
might work but it's maybe a bit confusing, and error-prone. The difference with regular
parZip
is that the finalisers would run in parallel.