- Can you name two mechanisms for executing code in the background for JVM applications?
- Thread
- Executors
- CompleteableFuture
- RxJava
- When was CompleteableFuture introduced to Java?
- What is RxJava?
- It is the JVM implementation of Reactive Streams, which can be used for simple asynchronous operations or for fully reactive programming.
- What are coroutines?
- They are a solution for structured concurrency that enable us to write asynchronous code in an imperative, non-blocking way.
- What is structural concurrency?
- It is the concept of scoping coroutines and their execution to different scopes that can be controlled and canceled throughout the lifetime of an application.
- Why are different coroutine builders useful?
- They enable us to control how our coroutines are configured, run, and responded to. They could be used to bridge non-blocking and blocking portions of our code base, or to control the scopes in which our coroutines are associated.
- What are suspending functions?
- They are functions with the suspend function added to their declaration, which indicates that the function can suspend the operation of a coroutine. They can be used to write functions that perform long-running tasks that can then be called from within a coroutine.