Kotlin Programming

  1. Concurrency with Coroutines
    1. Introduction to Asynchronous Programming
      1. Synchronous vs. Asynchronous Execution
        1. Threading Challenges
          1. Callbacks and Callback Hell
            1. Futures and Promises
              1. Reactive Extensions Overview
                1. Motivation for Coroutines
                2. Core Coroutine Concepts
                  1. Suspending Functions (`suspend`)
                    1. Coroutine Builders
                      1. `launch`
                        1. `async`
                          1. `runBlocking`
                            1. `withContext`
                            2. Coroutine Scope
                              1. `CoroutineScope`
                                1. `GlobalScope`
                                  1. Custom Scopes
                                  2. Coroutine Context
                                    1. Context Elements
                                      1. Combining Contexts
                                      2. Structured Concurrency
                                        1. Parent-Child Relationships
                                          1. Scope Cancellation
                                        2. Dispatchers
                                          1. `Dispatchers.Main`
                                            1. `Dispatchers.IO`
                                              1. `Dispatchers.Default`
                                                1. `Dispatchers.Unconfined`
                                                  1. Custom Dispatchers
                                                    1. Thread Pools
                                                      1. Dispatcher Selection Guidelines
                                                      2. Jobs and Cancellation
                                                        1. The `Job` Interface
                                                          1. Job Lifecycle
                                                            1. Job States
                                                              1. Cooperative Cancellation
                                                                1. Cancellation Exceptions
                                                                  1. Non-Cancellable Blocks
                                                                    1. Timeouts and Deadlines
                                                                      1. `withTimeout`
                                                                        1. `withTimeoutOrNull`
                                                                      2. Asynchronous Flow
                                                                        1. Introduction to `Flow`
                                                                          1. Cold vs. Hot Streams
                                                                            1. Creating Flows
                                                                              1. Flow Builders
                                                                                1. `flow`
                                                                                  1. `flowOf`
                                                                                    1. `asFlow`
                                                                                    2. Channel-Based Flows
                                                                                    3. Terminal Flow Operators
                                                                                      1. `collect`
                                                                                        1. `first`
                                                                                          1. `last`
                                                                                            1. `single`
                                                                                              1. `toList`
                                                                                                1. `toSet`
                                                                                                2. Intermediate Flow Operators
                                                                                                  1. `map`
                                                                                                    1. `filter`
                                                                                                      1. `onEach`
                                                                                                        1. `take`
                                                                                                          1. `drop`
                                                                                                            1. `transform`
                                                                                                              1. `distinctUntilChanged`
                                                                                                              2. Flow Context and Threading
                                                                                                                1. Buffering and Conflation
                                                                                                                  1. `buffer`
                                                                                                                    1. `conflate`
                                                                                                                      1. `collectLatest`
                                                                                                                      2. Flow Completion
                                                                                                                        1. `onCompletion`
                                                                                                                          1. Completion Exceptions
                                                                                                                          2. Exception Handling in Flows
                                                                                                                            1. `catch`
                                                                                                                              1. Exception Transparency
                                                                                                                            2. Channels
                                                                                                                              1. Channel Basics
                                                                                                                                1. Channel Types
                                                                                                                                  1. Rendezvous Channel
                                                                                                                                    1. Buffered Channel
                                                                                                                                      1. Conflated Channel
                                                                                                                                        1. Unlimited Channel
                                                                                                                                        2. Sending and Receiving Data
                                                                                                                                          1. `send` and `receive`
                                                                                                                                            1. `trySend` and `tryReceive`
                                                                                                                                            2. Closing Channels
                                                                                                                                              1. Channel Iteration
                                                                                                                                                1. Producer-Consumer Pattern
                                                                                                                                                2. Exception Handling in Coroutines
                                                                                                                                                  1. Exception Propagation
                                                                                                                                                    1. Supervisor Jobs
                                                                                                                                                      1. `SupervisorJob`
                                                                                                                                                        1. `supervisorScope`
                                                                                                                                                        2. CoroutineExceptionHandler
                                                                                                                                                          1. Exception Handling Strategies
                                                                                                                                                          2. Sharing State and Concurrency Primitives
                                                                                                                                                            1. Thread Safety Issues
                                                                                                                                                              1. Mutex
                                                                                                                                                                1. Semaphore
                                                                                                                                                                  1. Atomic Variables
                                                                                                                                                                    1. Thread-Safe Collections
                                                                                                                                                                      1. Actor Pattern
                                                                                                                                                                      2. Testing Coroutines
                                                                                                                                                                        1. Test Dispatchers
                                                                                                                                                                          1. `runTest`
                                                                                                                                                                            1. Testing Flows
                                                                                                                                                                              1. Mocking Suspending Functions