Is it possible to create a `com.squareup.wire.Grpc...
# squarelibraries
t
Is it possible to create a
com.squareup.wire.GrpcClient
in Kotlin/JS?
j
Nothing exists currently
b
The client is now open (abstract) though, so you’re able to implement it yourself
t
I wrote some code that seems to work (?) but I'm no expert on coroutines. @jessewilson / @Benoit Quenaudon / anyone, would you care to take a look? https://gist.github.com/tianyu/36ecf8e5a2a936f008ea61f97e04abc0
b
Are you sure ktor can do duplex calls?
t
@Benoit Quenaudon ktor does not support full duplex. Here's what I think is feasible: • Supported: Single message in, single message out. • Supported: Single message in, streaming messages out. • Supported (maybe?): Streaming messages in, single message out. • Not supported: Full duplex. ◦ Supported (maybe?): Streaming all messages in before streaming all messages out. In general, I think we can support any communication pattern where the entire request is sent before any response is expected. Unsurprisingly, we won't be able to support "conversational" communication patterns where requests and responses are sent concurrently. However, it's exciting that we might be able to support a wider variety of rpcs than the grpc-web project!
b
What I would suggest is for you to test your implementation within Wire for the tests we have in https://github.com/square/wire/tree/master/wire-grpc-tests/src/test/java/com/squareup/wire Check where you can replace the GrpcClient implementation with your own and see how it goes.