Skip to content

Instantly share code, notes, and snippets.

🛰
Orbiting greatness!

Alex Katlein vemilyus

🛰
Orbiting greatness!
Block or report user

Report or block vemilyus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@vemilyus
vemilyus / ActorState.kt
Created Dec 30, 2018
Sample implementation of ActorState with read-write separation
View ActorState.kt
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.ObsoleteCoroutinesApi
import kotlinx.coroutines.channels.actor
import kotlinx.coroutines.isActive
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import kotlin.coroutines.CoroutineContext
interface ActorState<T : Any> : CoroutineScope {
You can’t perform that action at this time.