Skip to content

Commit

Permalink
Fix WS Next CDI events documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
michalvavrik committed Jun 13, 2024
1 parent 00bf910 commit 2104846
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/src/main/asciidoc/websockets-next-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -523,18 +523,18 @@ For example, `OpenConnections#findByEndpointId(String)` makes it easy to find co

=== CDI events

Quarkus fires a CDI event of type `io.quarkus.websockets.next.WebSocketConnection` with qualifier `@io.quarkus.websockets.next.ConnectionOpen` asynchronously when a new connection is opened.
Moreover, a CDI event of type `WebSocketConnection` with qualifier `@io.quarkus.websockets.next.ConnectionClosed` is fired asynchronously when a connection is closed.
Quarkus fires a CDI event of type `io.quarkus.websockets.next.WebSocketConnection` with qualifier `@io.quarkus.websockets.next.Open` asynchronously when a new connection is opened.
Moreover, a CDI event of type `WebSocketConnection` with qualifier `@io.quarkus.websockets.next.Closed` is fired asynchronously when a connection is closed.

[source, java]
----
import jakarta.enterprise.event.ObservesAsync;
import io.quarkus.websockets.next.ConnectionOpen;
import io.quarkus.websockets.next.Open;
import io.quarkus.websockets.next.WebSocketConnection;
class MyBean {
void connectionOpened(@ObservesAsync @ConnectionOpen WebSocketConnection connection) { <1>
void connectionOpened(@ObservesAsync @Open WebSocketConnection connection) { <1>
// This observer method is called when a connection is opened...
}
}
Expand Down

0 comments on commit 2104846

Please sign in to comment.