Lifecycles, Coroutines and Scopes | Alejandro Serrano Mena

Поделиться
HTML-код
  • Опубликовано: 3 окт 2024
  • Recording brought to you by American Express. americanexpres...
    Structured concurrency is one of the key ideas in the Kotlin language, ensuring correct and intuitive cancellation and supervision of jobs. In this talk we look at how these ideas translate when coroutines are introduced in other frameworks with their own lifecycles, like Spring services or Android applications.
    Another way to think about this talk is a search for every usage of CoroutineScope in Kotlin libraries, and understand how that bridges the world of coroutines.
    Jobs are not the only lifecycle-aware pattern in Kotlin. The Arrow library provides other two examples: resource management, and distributed transactions. By the end of the talk, you'll be able to see the commonalities, and have a better understanding of all those interfaces ending in Scope.
    Due to technical difficulties, this talk was not properly recorded during the conference. Alejandro kindly agreed to re-record it at the JetBrains office.

Комментарии • 10

  • @alexismanin5239
    @alexismanin5239 2 месяца назад +2

    Very clear, it really helped me better understand the power of coroutine scopes 👍

  • @aungkhanthtoo7678
    @aungkhanthtoo7678 3 месяца назад +6

    Great talk!

  • @evgeniyemelyanov7281
    @evgeniyemelyanov7281 3 месяца назад +2

    Great explanation, thanks!

  • @Jlin1982
    @Jlin1982 2 месяца назад +1

    Greate talk

  • @RuslanPeshchuk
    @RuslanPeshchuk Месяц назад

    ❤ thanks

  • @Heksapoda
    @Heksapoda 3 месяца назад

    Is it mean that Activity initiate a Thread and exist until the Activity destroyed then other components could use that Thread to do asynchronous job?

    • @rahu-gill
      @rahu-gill 2 месяца назад

      no, all code you write in an activity is by default run in the single ui thread

  • @azzdine7453
    @azzdine7453 Месяц назад

    Guys someone help me please, i'am doing very fast update to the local database (room) the problem is sometimes the database is not updating, i tried viewModelLunch scope and dispatcher IO , any one can help or have idea please and thank you ..

    • @alexanderbernat182
      @alexanderbernat182 Месяц назад +1

      You need to make a scope for database handling wider than your view model. For example, create a repository tied to app lifecycle. In this case your jobs will not be cancelled by narrow view model scopes.

    • @azzdine7453
      @azzdine7453 Месяц назад

      @@alexanderbernat182 I will try that thank you