forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WebSockets Next: allow Uni<Void> as a return type of Kotlin @onpong and
@onclose methods
- Loading branch information
Showing
8 changed files
with
90 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...s-next/deployment/src/test/kotlin/io/quarkus/websockets/next/test/kotlin/BinaryEchoUni.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package io.quarkus.websockets.next.test.kotlin | ||
|
||
import io.quarkus.websockets.next.OnBinaryMessage | ||
import io.quarkus.websockets.next.OnClose | ||
import io.quarkus.websockets.next.WebSocket | ||
import io.smallrye.mutiny.Uni | ||
import io.vertx.core.buffer.Buffer | ||
import kotlinx.coroutines.delay | ||
|
||
@WebSocket(path = "/binary-echo-uni") | ||
class BinaryEchoUni { | ||
@OnBinaryMessage | ||
fun process(msg: Buffer): Uni<Buffer> { | ||
return Uni.createFrom().item(msg) | ||
} | ||
|
||
|
||
@OnClose | ||
fun close(): Uni<Void> { | ||
return Uni.createFrom().voidItem() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...sockets-next/deployment/src/test/kotlin/io/quarkus/websockets/next/test/kotlin/EchoUni.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.quarkus.websockets.next.test.kotlin | ||
|
||
import io.quarkus.websockets.next.OnClose | ||
import io.quarkus.websockets.next.OnTextMessage | ||
import io.quarkus.websockets.next.WebSocket | ||
import io.smallrye.mutiny.Uni | ||
|
||
@WebSocket(path = "/echo-uni") | ||
class EchoUni { | ||
@OnTextMessage | ||
fun process(msg: Message): Uni<Message> { | ||
return Uni.createFrom().item(msg) | ||
} | ||
|
||
@OnClose | ||
fun close(): Uni<Void> { | ||
return Uni.createFrom().voidItem() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters