Skip to Main Content
Learn Spring for Android Application Development
book

Learn Spring for Android Application Development

by S. M. Mohi Us Sunnat, Igor Kucherenko
January 2019
Intermediate to advanced content levelIntermediate to advanced
392 pages
10h 11m
English
Packt Publishing
Content preview from Learn Spring for Android Application Development

Coroutine scope

With the release of version 0.26.0 of coroutines, a new, important feature was introduced—coroutine scope. All of the coroutine builders from the coroutines-core library are extension functions of the CoroutineScope interface.

The CoroutineScope interface looks as follows:

public interface CoroutineScope {       @Deprecated(level = DeprecationLevel.HIDDEN, message = "Deprecated in favor of top-level extension property")    public val isActive: Boolean        get() = coroutineContext[Job]?.isActive ?: true    public val coroutineContext: CoroutineContext}

We need the coroutine scope to provide a proper cancellation mechanism for the coroutines that we launch in our application. Modern frameworks, such as Android SDK or React Native, are built ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Building Applications with Spring 5 and Vue.js 2

Building Applications with Spring 5 and Vue.js 2

James J. Ye

Publisher Resources

ISBN: 9781789349252Supplemental Content