- Type: Design proposal
- Author: Dico Karssiens
- Contributors: []
- Status: Submitted
- Prototype: Not implemented, but I would be happy to do so
//Fill in issue below once created.
Discussion of this proposal is held in this issue.
//Fill in issue below once created.
Discussion of this proposal is held in this issue.
package io.dico.parcels2.util | |
import kotlinx.coroutines.* | |
import kotlin.coroutines.CoroutineContext | |
/** | |
* Return the context of the coroutine that (directly or indirectly) called this function. | |
* Does not work when the thread is changed. | |
* | |
* Requires that the coroutine context contains [CoroutineContextStoringElement] to work. |
@file:Suppress("UNCHECKED_CAST") | |
import org.gradle.api.Project | |
import org.gradle.api.plugins.ExtensionAware | |
import org.gradle.kotlin.dsl.get | |
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension | |
import org.jetbrains.kotlin.gradle.plugin.* | |
import org.jetbrains.kotlin.gradle.plugin.mpp.* | |
import org.jetbrains.kotlin.gradle.plugin.sources.DefaultKotlinSourceSet | |
import kotlin.reflect.KProperty |
import kotlinx.coroutines.* | |
import kotlinx.coroutines.channels.* | |
import kotlin.coroutines.CoroutineContext | |
import kotlin.coroutines.EmptyCoroutineContext | |
class BehaviorSubjectChannel<E>(val del: BroadcastChannel<E>, context: CoroutineContext? = null) : BroadcastChannel<E> by del { | |
@Volatile | |
private var hasElem: Boolean = false | |
@Volatile | |
private var lastElem: E? = null |