Andreas Scheja
01/03/2023, 9:32 AMResponseSent and ReceiveRequestBytes hooks don't have suspending handlers? At least the latter is given a ByteReadChannel so suspending calls should be quite common?Aleksei Tirman [JB]
01/03/2023, 1:27 PMe5l
01/03/2023, 1:31 PMResponseSent ?
As for ReceiveRequestBytes, we can add suspension there. I made a ticket: https://youtrack.jetbrains.com/issue/KTOR-5406/Add-suspend-modifier-to-ReceiveRequestBytes-hookAndreas Scheja
01/03/2023, 3:27 PMResponseSent right now, but is there a compelling reason not to change it? I mean if you want to call something suspending in there (and can't just launch it in a fire-and-forget manner) you have to bridge it with runBlocking, which would block the thread of the coroutine calling the hook -> not a good solution for a busy server.