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

feat: streaming and threading improvements #191

Merged
merged 11 commits into from
Mar 14, 2024
Merged

Conversation

nplasterer
Copy link
Contributor

@nplasterer nplasterer commented Feb 29, 2024

This does a major overhaul of how we are doing async calls in Android. Switching from runBlocking to suspend functions for all send message functionality to help prevent deadlocking during streaming.

@nplasterer nplasterer self-assigned this Feb 29, 2024
@nplasterer nplasterer changed the title Bump to latest rust for streaming improvements feat: streaming and threading improvements Mar 13, 2024
@nplasterer nplasterer marked this pull request as ready for review March 13, 2024 03:49
@nplasterer nplasterer requested a review from a team as a code owner March 13, 2024 03:49
@@ -169,31 +169,31 @@ sealed class Conversation {
}
}

fun send(prepared: PreparedMessage): String {
suspend fun send(prepared: PreparedMessage): String {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@nplasterer nplasterer merged commit 0134852 into main Mar 14, 2024
5 of 6 checks passed
@nplasterer nplasterer deleted the np/bump-latest-rust branch March 14, 2024 04:18
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

Successfully merging this pull request may close these issues.

3 participants