https://kotlinlang.org logo
#coroutines
Title
# coroutines
c

Colton Idle

09/02/2021, 4:32 AM
Stumbled upon this today when trying out firebase for the first time. https://github.com/Kotlin/kotlinx.coroutines/tree/master/integration/kotlinx-coroutines-play-services Why does kotlin have google play services intergration? Vs the opposite (play services having coroutine support)? Mostly curious if this is something I could seriously adopt or if its just experimental from kotlin team.
o

Orhan Tozan

09/02/2021, 10:35 AM
1. I think the reason why Kotlin decided to make the google play services coroutines integration themselves is because it is in their interest for people to use coroutines, thus want to encourage coroutines use 2. It is not experimental, using it in production for almost 2 years
c

Colton Idle

09/02/2021, 3:04 PM
@Orhan Tozan thanks. Glad to know someone else who is using it. Do you also use it for snapshot listeners in firestore? Basically, suspend functions make sense for one shot get requests, but what about observing a stream? Have you had luck with that?
o

Orhan Tozan

09/02/2021, 3:05 PM
Never used Firestore on Android, only used it with Firebase auth. I don't know if they also wrapped the streams with flows. If not, you have to wrap it yourself with callbackFlow
c

Colton Idle

09/02/2021, 3:07 PM
Got it. I have to implement firebase auth also so that helps that I can use it there.
o

Orhan Tozan

09/02/2021, 3:09 PM
Perhaps a relevant library for you: https://github.com/GitLiveApp/firebase-kotlin-sdk
c

Colton Idle

09/02/2021, 3:21 PM
Sweet thanks!
3 Views