diff --git a/trikot-streams/streams/api/android/streams.api b/trikot-streams/streams/api/android/streams.api index 68949f93..5c971930 100644 --- a/trikot-streams/streams/api/android/streams.api +++ b/trikot-streams/streams/api/android/streams.api @@ -23,17 +23,24 @@ public abstract interface class com/mirego/trikot/streams/cancellable/Cancellabl public abstract fun cancel ()V } -public final class com/mirego/trikot/streams/cancellable/CancellableManager : com/mirego/trikot/streams/cancellable/Cancellable { +public final class com/mirego/trikot/streams/cancellable/CancellableManager : com/mirego/trikot/streams/cancellable/Cancellable, com/mirego/trikot/streams/cancellable/VerifiableCancelledState { public fun ()V public final fun add (Lcom/mirego/trikot/streams/cancellable/Cancellable;)Lcom/mirego/trikot/streams/cancellable/Cancellable; public final fun add (Lkotlin/jvm/functions/Function0;)V public fun cancel ()V + public final fun cleanCancelledChildren ()V + public fun isCancelled ()Z } -public final class com/mirego/trikot/streams/cancellable/CancellableManagerProvider : com/mirego/trikot/streams/cancellable/Cancellable { +public final class com/mirego/trikot/streams/cancellable/CancellableManagerProvider : com/mirego/trikot/streams/cancellable/Cancellable, com/mirego/trikot/streams/cancellable/VerifiableCancelledState { public fun ()V public fun cancel ()V public final fun cancelPreviousAndCreate ()Lcom/mirego/trikot/streams/cancellable/CancellableManager; + public fun isCancelled ()Z +} + +public abstract interface class com/mirego/trikot/streams/cancellable/VerifiableCancelledState { + public abstract fun isCancelled ()Z } public final class com/mirego/trikot/streams/reactive/AndroidPublisherExtensionsKt { diff --git a/trikot-streams/streams/api/jvm/streams.api b/trikot-streams/streams/api/jvm/streams.api index c4a944c1..c6068f9c 100644 --- a/trikot-streams/streams/api/jvm/streams.api +++ b/trikot-streams/streams/api/jvm/streams.api @@ -23,17 +23,24 @@ public abstract interface class com/mirego/trikot/streams/cancellable/Cancellabl public abstract fun cancel ()V } -public final class com/mirego/trikot/streams/cancellable/CancellableManager : com/mirego/trikot/streams/cancellable/Cancellable { +public final class com/mirego/trikot/streams/cancellable/CancellableManager : com/mirego/trikot/streams/cancellable/Cancellable, com/mirego/trikot/streams/cancellable/VerifiableCancelledState { public fun ()V public final fun add (Lcom/mirego/trikot/streams/cancellable/Cancellable;)Lcom/mirego/trikot/streams/cancellable/Cancellable; public final fun add (Lkotlin/jvm/functions/Function0;)V public fun cancel ()V + public final fun cleanCancelledChildren ()V + public fun isCancelled ()Z } -public final class com/mirego/trikot/streams/cancellable/CancellableManagerProvider : com/mirego/trikot/streams/cancellable/Cancellable { +public final class com/mirego/trikot/streams/cancellable/CancellableManagerProvider : com/mirego/trikot/streams/cancellable/Cancellable, com/mirego/trikot/streams/cancellable/VerifiableCancelledState { public fun ()V public fun cancel ()V public final fun cancelPreviousAndCreate ()Lcom/mirego/trikot/streams/cancellable/CancellableManager; + public fun isCancelled ()Z +} + +public abstract interface class com/mirego/trikot/streams/cancellable/VerifiableCancelledState { + public abstract fun isCancelled ()Z } public abstract interface class com/mirego/trikot/streams/reactive/BehaviorSubject : com/mirego/trikot/streams/reactive/MutablePublisher { diff --git a/trikot-streams/streams/src/commonMain/kotlin/com/mirego/trikot/streams/cancellable/CancellableManager.kt b/trikot-streams/streams/src/commonMain/kotlin/com/mirego/trikot/streams/cancellable/CancellableManager.kt index 58244c4a..aa408480 100644 --- a/trikot-streams/streams/src/commonMain/kotlin/com/mirego/trikot/streams/cancellable/CancellableManager.kt +++ b/trikot-streams/streams/src/commonMain/kotlin/com/mirego/trikot/streams/cancellable/CancellableManager.kt @@ -9,7 +9,7 @@ class CancellableManager : Cancellable, VerifiableCancelledState { private val queueList = AtomicListReference() private var isCancelledDelegate = atomic(false) - override var isCancelled: Boolean by isCancelledDelegate + override val isCancelled: Boolean by isCancelledDelegate fun add(cancellable: T): T { queueList.add(cancellable)