Package io.quarkus.websockets.next
Annotation Interface OnClose
@Retention(RUNTIME)
@Target(METHOD)
@Experimental("This API is experimental and may change in the future")
public @interface OnClose
WebSocket and WebSocketClient endpoint methods annotated with this annotation are invoked when a connection
is closed. An endpoint may declare at most one method annotated with this annotation. The method must return void or
io.smallrye.mutiny.Uni<Void>.
Execution model
- Methods annotated with
RunOnVirtualThreadare considered blocking and should be executed on a virtual thread. - Methods annotated with
Blockingare considered blocking and should be executed on a worker thread. - Methods annotated with
NonBlockingare considered non-blocking and should be executed on an event loop thread.
- Methods returning
voidare considered blocking and should be executed on a worker thread. - Methods returning
io.smallrye.mutiny.Uni<Void>are considered non-blocking and should be executed on an event loop thread.
Method parameters
The method may accept the following parameters:WebSocketConnection/WebSocketClientConnection; depending on the endpoint typeHandshakeRequestStringparameters annotated withPathParamCloseReason