mirror of
https://github.com/ProtonMail/protoncore_android.git
synced 2026-05-15 09:50:41 +00:00
feat(event-manager): Added EventManager resume function.
This commit is contained in:
+4
@@ -452,6 +452,10 @@ class EventManagerImpl @AssistedInject constructor(
|
||||
lock.withLock { internalStop() }
|
||||
}
|
||||
|
||||
override suspend fun resume() {
|
||||
lock.withLock { enqueueOrStop(immediately = true, failure = false) }
|
||||
}
|
||||
|
||||
override suspend fun <R> suspend(block: suspend () -> R): R {
|
||||
lock.withLock { return internalSuspend(block) }
|
||||
}
|
||||
|
||||
+7
@@ -51,6 +51,13 @@ interface EventManager {
|
||||
*/
|
||||
suspend fun stop()
|
||||
|
||||
/**
|
||||
* Resume the Event loop execution.
|
||||
*
|
||||
* This call can be used to force the Event loop to run on demand, regardless of its existing schedule.
|
||||
*/
|
||||
suspend fun resume()
|
||||
|
||||
/**
|
||||
* Pause the Event loop, calls the specified function [block], and resume the loop.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user