93dd6e8d changed `getEvents()` to `events` property. This is fine for Java consumers, as `events` getter resolves to `getEvents()` in JVM, but Kotlin consumers using `getEvents()` will fail compilation, as this method no longer exists.
This commit introduces a deprecated, JVM synthetic `getEvents` methods to keep Kotlin source compatibility.
This introduces consistent behavior when advancing the virtual time in a `runTest` block in a test class that uses `RibCoroutinesRule`: all dispatchers from `RibDispatchers` will advance in time, as opposed to the current implementation where only the main dispatcher will advance in time.
Fixes#540.
The `CoroutineScope` instance will be cached only until it is completed.
This new behavior of clearing the cache upon completion effectively allows for re-launching coroutines on the attach callback when an attach-detach-attach cycle occurs on `ScopeProvider` components with a lifecycle.
Re-launching coroutines upon reattachment is not possible in current implementation (without this fix): a single `CoroutineScope` is cached for the whole life of the instance, and `ScopeProvider.coroutineScope` delivers a stale, cancelled instance of `CoroutineScope` after reattaching the component (even though `ScopeProvider.requestScope()` delivers a new `Completable`.
To be clear, the correct reattachment behavior is already in place for Rx subscriptions that `autoDispose` by `ScopeProvider`: they are backed by the `Completable`, which work fine on attach-detach-reattach cycles. This commit makes coroutines behavior consistent with the currently established behavior in RIBs.
Fixes#535.