MoshiConverter crashes with: "Using blocking primitives on this dispatcher is not allowed. Consider using async channel instead or use blocking primitives in withContext(Dispatchers.IO) instead."
What you need to do is (In the MoshiConverter):
return withContext(Dispatchers.IO) {
val source = channel.toInputStream().source().buffer()
val type = request.type
moshi.adapter(type.javaObjectType).fromJson(source)
}
MoshiConverter crashes with: "Using blocking primitives on this dispatcher is not allowed. Consider using async channel instead or use blocking primitives in withContext(Dispatchers.IO) instead."
What you need to do is (In the MoshiConverter):