Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash: Using blocking primitives on this dispatcher is not allowed #11

Open
1gravity opened this issue Apr 12, 2021 · 0 comments
Open

Comments

@1gravity
Copy link

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)
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant