-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat: streaming and threading improvements #191
Conversation
@@ -169,31 +169,31 @@ sealed class Conversation { | |||
} | |||
} | |||
|
|||
fun send(prepared: PreparedMessage): String { | |||
suspend fun send(prepared: PreparedMessage): String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a breaking change, or will existing code continue to work (albeit no longer waiting for the publish to complete)? Not in this PR, but long-term do we have any thoughts on splitting out the two conversation types, and allowing the API's to be different across the two to maintain backwards compatibility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically it's a breaking change if anyone was using send outside of a thread. As you can see there are no changes to the example app in this PR because my example app was already calling send in a thread so I honestly think this change may be unnoticeable to most integrators as they were likely sending it asynchronously anyways.
This does a major overhaul of how we are doing async calls in Android. Switching from
runBlocking
tosuspend
functions for all send message functionality to help prevent deadlocking during streaming.