Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New integration: AndroidX Lifecycle #760

Closed
wants to merge 10 commits into from
Closed

New integration: AndroidX Lifecycle #760

wants to merge 10 commits into from

Commits on Nov 5, 2018

  1. New integration: AndroidX Lifecycle

    Includes:
    - Job and CoroutineScope extensions for Lifecycle and LifecycleOwner
    - Transitive dependency to kotlinx-android artifact
    - Tests and test supporting code
    - Documentation
    - Entry in binary-compatibility-validator build.gradle file
    LouisCAD committed Nov 5, 2018
    Configuration menu
    Copy the full SHA
    3cbe424 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5b59a93 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5df9041 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    82af7d6 View commit details
    Browse the repository at this point in the history
  5. Move AndroidX lifecycle coroutineScope extensions

    …to LifecycleDefaultScopes.kt
    
    That is to prevent class initialization in case they are not used.
    LouisCAD committed Nov 5, 2018
    Configuration menu
    Copy the full SHA
    39c5df3 View commit details
    Browse the repository at this point in the history
  6. Add cached into the jobs and scopes cache maps

    This makes the intent more explicit
    LouisCAD committed Nov 5, 2018
    Configuration menu
    Copy the full SHA
    5ae0603 View commit details
    Browse the repository at this point in the history
  7. Replace ConcurrentHashMap by mutableMapOf

    Because the maps are just a best effort cache, we don't need the
    concurrency safety that ConcurrentHashMap offers.
    
    If the scopes or jobs are accessed concurrently, there may be multiple
    created instances, but eventually, an attempt to remove them from the
    caching map will always be performed when the lifecycle is destroyed.
    LouisCAD committed Nov 5, 2018
    Configuration menu
    Copy the full SHA
    428b78c View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    6d4261a View commit details
    Browse the repository at this point in the history
  9. Add Lifecycle observer only on next event loop

    This allows to support use cases like creating a scope active while
    STARTED from an Activity onStart() method.
    LouisCAD committed Nov 5, 2018
    Configuration menu
    Copy the full SHA
    a4a6621 View commit details
    Browse the repository at this point in the history

Commits on Nov 7, 2018

  1. Fix possible concurrency issues

    Replacing mutableMapOf() with ConcurrentHashMap().
    Regular HashMap could lead to an infinite loop in some cases where the
    map would be accessed concurrently.
    LouisCAD committed Nov 7, 2018
    Configuration menu
    Copy the full SHA
    25e26ff View commit details
    Browse the repository at this point in the history