Anybody used coroutines with FirebaseMessagingServ...
# coroutines
u
Anybody used coroutines with FirebaseMessagingService for push messages? Is runBlocking needed or is sideffecting to a custom scope okay? I'm afraid there are som wakelocks hooked up to around the blocking onMessageReceived? Althought I don't see it in sources (but I see wakelocks being held in sysdump) My whole architecture is sideffecting into private scopes and exposing Flow<State>, so if it's needing to be blocking, I kind of have a problem
Copy code
class SomeSyncer {
	private val scope = CoroutineScope ..

	private val _state = MutableFlow...
	val state: Flow<State> get() = _state

	fun sync() {
		scope.launch {
			_state.value = RUNNING
			doSync()
			_state.value = IDLE
		}
	}
}

class FcmService : FirebaseMessageingService {
	override onMessageReceived() {
		someSyncer.sync() ?

		or
		
		runBlocking {
			someSyncer.sync() ..somehow make it wait? maybe the lowercase coroutineScope?
		}
	}
}
I could also expose the
suspend doSync
as some public api, but I'm gonna lose the state tracking, and also, it's never necessary within the app normally, just this "edge" framework case