Created
August 17, 2018 19:26
-
-
Save slavkoder/ecf37cf6cf2bd8536cbd78d001339ff2 to your computer and use it in GitHub Desktop.
Add onErrorResumeNext
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
class ApptimizeBivariantTestFeature(private val experimentTag: String) : IFeature { | |
override fun isEnabled(): Single<Boolean> { | |
return Single.create<Boolean> { emitter: SingleEmitter<Boolean> -> | |
Apptimize.runTest(experimentTag, object : ApptimizeTest() { | |
override fun baseline() { | |
// Variant: control, treat as disabled | |
emitter.onSuccess(false) | |
} | |
@Suppress("unused") | |
fun variation1() { | |
// Variant: variation1, treat as enabled | |
emitter.onSuccess(true) | |
} | |
}) | |
}.onErrorResumeNext { | |
Timber.w(it, "Experiment: $experimentTag") | |
Single.just(false) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment