0.3.1 release: async pushes and better binary format
This commit is contained in:
1 parent
8a21a836e5
commit
d6f257de14
26 files changed
+290
-93
No files matched your search
@@ -184,10 +184,16 @@ class TransportTest {
|
||||
val cmdRemoteExceptionTest by command<Unit, String>()
|
||||
val cmdBreak by command<Unit, Unit>()
|
||||
|
||||
val cmdPushServer by push<String>()
|
||||
val pushedFromServer = CompletableDeferred<String>()
|
||||
|
||||
val serverInterface = KiloInterface<String>().apply {
|
||||
on(cmdPing) {
|
||||
"pong! [$it]"
|
||||
}
|
||||
on(cmdPushServer) {
|
||||
pushedFromServer.complete(it)
|
||||
}
|
||||
on(cmdGetToken) {
|
||||
sessionToken
|
||||
}
|
||||
@@ -249,11 +255,17 @@ class TransportTest {
|
||||
assertEquals("client pong: foo", kiloServerConnection.call(cmdPing, "foo"))
|
||||
assertEquals("server push: bar", kiloServerConnection.call(cmdPush, "bar"))
|
||||
|
||||
client.push(cmdPushServer, "42")
|
||||
|
||||
assertEquals("**-s1-c1-s2-c2", client.call(cmdChainCallServer1, "**"))
|
||||
|
||||
|
||||
assertThrows<TestException> { client.call(cmdException) }
|
||||
assertEquals("ok: te-local", client.call(cmdRemoteExceptionTest))
|
||||
|
||||
// wait for push to be received and check
|
||||
assertEquals("42", pushedFromServer.await())
|
||||
|
||||
assertThrows<RemoteInterface.ClosedException> {
|
||||
client.call(cmdBreak)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user