Wrote a redis client using coroutines, feedback we...
# coroutines
r
Wrote a redis client using coroutines, feedback welcome! https://github.com/rrva/coredis
đź‘Ť 2
l
I see you are using ktor, is the ktor socket non blocking?
also are there major benefits to using coroutines verses threads other than how the code looks? I ask because I think redis is single threaded so having many async connections might not do much as far as I can tell
r
I haven’t benchmarked this in any way comparing how a threaded client would perform comparing to this or not. The point is that the redis client functions are suspendable, allowing you to use them in other contexts where you want to use coroutines. Redis is probably mostly waiting for network I/O both on the client and server side.
l
Description says Redis client based on non-blocking I/O with Kotlin coroutines
but that really depends on if ktor is non blocking
you open x connections but all those take a thread that is blocking while the connection is being used right?
r
no, it uses java.nio.channels.SocketChannel in non-blocking mode