Skip to content

Commit

Permalink
KTOR-7276 Allow suspend function in ResponseSent hook
Browse files Browse the repository at this point in the history
  • Loading branch information
marychatte committed Nov 26, 2024
1 parent 418ff20 commit 1398106
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ktor-server/ktor-server-core/api/ktor-server-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public final class io/ktor/server/application/hooks/ResponseBodyReadyForSend$Con
public final class io/ktor/server/application/hooks/ResponseSent : io/ktor/server/application/Hook {
public static final field INSTANCE Lio/ktor/server/application/hooks/ResponseSent;
public synthetic fun install (Lio/ktor/server/application/ApplicationCallPipeline;Ljava/lang/Object;)V
public fun install (Lio/ktor/server/application/ApplicationCallPipeline;Lkotlin/jvm/functions/Function1;)V
public fun install (Lio/ktor/server/application/ApplicationCallPipeline;Lkotlin/jvm/functions/Function2;)V
}

public abstract interface class io/ktor/server/config/ApplicationConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ public object ResponseBodyReadyForSend :
* A hook that is invoked when response was successfully sent to a client.
* Useful for cleaning up opened resources or finishing measurements.
*/
public object ResponseSent : Hook<(ApplicationCall) -> Unit> {
override fun install(pipeline: ApplicationCallPipeline, handler: (ApplicationCall) -> Unit) {
public object ResponseSent : Hook<suspend (ApplicationCall) -> Unit> {
override fun install(pipeline: ApplicationCallPipeline, handler: suspend (ApplicationCall) -> Unit) {
pipeline.sendPipeline.intercept(ApplicationSendPipeline.Engine) {
proceed()
handler(call)
Expand Down

0 comments on commit 1398106

Please sign in to comment.