This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Inspired by Jaewoong Eum's flow-operators library (https://github.com/skydoves/flow-operators). | |
*/ | |
class Restartable { | |
private val restartFlow = MutableSharedFlow<SharingCommand>(extraBufferCapacity = 2) | |
fun restart() { | |
restartFlow.tryEmit(SharingCommand.STOP_AND_RESET_REPLAY_CACHE) |