diff --git a/rd-kt/rd-framework/src/main/kotlin/com/jetbrains/rd/framework/base/RdExtBase.kt b/rd-kt/rd-framework/src/main/kotlin/com/jetbrains/rd/framework/base/RdExtBase.kt index c501f5c17..cd2c9b4db 100644 --- a/rd-kt/rd-framework/src/main/kotlin/com/jetbrains/rd/framework/base/RdExtBase.kt +++ b/rd-kt/rd-framework/src/main/kotlin/com/jetbrains/rd/framework/base/RdExtBase.kt @@ -73,7 +73,7 @@ abstract class RdExtBase : RdReactiveBase() { val scheduler = when (extThreading) { ExtThreadingKind.Default -> parentProtocol.scheduler ExtThreadingKind.CustomScheduler -> CustomExtScheduler() - ExtThreadingKind.AllowBackgroundCreation -> ExtSchedulerWrapper(parentProtocol.scheduler) + ExtThreadingKind.AllowBackgroundCreation -> parentProtocol.scheduler } val signal = createExtSignal() @@ -86,8 +86,10 @@ abstract class RdExtBase : RdReactiveBase() { if (scheduler is ExtSchedulerBase && extThreading != ExtThreadingKind.Default) scheduler.setActiveCurrentThread(activeLifetime) - super.preInit(lifetime, proto) - super.init(lifetime, proto, ctx) + AllowBindingCookie.allowBind { + super.preInit(lifetime, proto) + super.init(lifetime, proto, ctx) + } val info = ExtCreationInfo(location, (parent as? RdBindableBase)?.containingExt?.rdid, serializationHash, this) @@ -172,6 +174,8 @@ abstract class RdExtBase : RdReactiveBase() { enum class ExtThreadingKind { Default, CustomScheduler, + + @Deprecated("Creating on the background is allowed by default") AllowBackgroundCreation } } @@ -198,23 +202,6 @@ internal abstract class ExtSchedulerBase : IScheduler { } } -internal class ExtSchedulerWrapper(val realScheduler: IScheduler) : ExtSchedulerBase() { - - override fun queue(action: () -> Unit) { - realScheduler.queue(action) - } - - override val isActive: Boolean - get() = realScheduler.isActive || isActiveThread() - - override val executionOrder: ExecutionOrder - get() = realScheduler.executionOrder - - override fun flush() { - throw InvalidOpenTypeException("Unsupported") - } -} - internal class CustomExtScheduler : ExtSchedulerBase() { private val locker = Any() diff --git a/rd-kt/rd-gen/src/main/kotlin/com/jetbrains/rd/generator/nova/kotlin/Kotlin11Generator.kt b/rd-kt/rd-gen/src/main/kotlin/com/jetbrains/rd/generator/nova/kotlin/Kotlin11Generator.kt index 89c154391..f09a4d2d2 100644 --- a/rd-kt/rd-gen/src/main/kotlin/com/jetbrains/rd/generator/nova/kotlin/Kotlin11Generator.kt +++ b/rd-kt/rd-gen/src/main/kotlin/com/jetbrains/rd/generator/nova/kotlin/Kotlin11Generator.kt @@ -47,6 +47,7 @@ open class Kotlin11Generator( enum class ExtThreadingKind { Default, CustomScheduler, + @Deprecated("Creating on the background is allowed by default") AllowBackgroundCreation }