https://github.com/halilozel1903/coroutines101
It's a project with examples of using Coroutines. ๐งต You will learn the concepts (GlobalScope, runBlocking, Nested Coroutine, Dispatcher, Suspend Function) ๐ป
https://github.com/halilozel1903/coroutines101
coroutine coroutines coroutines-android coroutines-channels coroutines-flow coroutines-io coroutines-kotlin coroutines-retrofit coroutines-room coroutines-testing coroutines-ts kotlin-android kotlin-coroutines kotlin-example kotlin-examples kotlin-lang kotlin-language kotlin-tutorial kotlin-tutorials
Last synced: 9 days ago
JSON representation
It's a project with examples of using Coroutines. ๐งต You will learn the concepts (GlobalScope, runBlocking, Nested Coroutine, Dispatcher, Suspend Function) ๐ป
- Host: GitHub
- URL: https://github.com/halilozel1903/coroutines101
- Owner: halilozel1903
- Created: 2021-12-29T12:45:19.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T16:25:27.000Z (over 1 year ago)
- Last Synced: 2025-04-05T12:23:16.437Z (about 1 month ago)
- Topics: coroutine, coroutines, coroutines-android, coroutines-channels, coroutines-flow, coroutines-io, coroutines-kotlin, coroutines-retrofit, coroutines-room, coroutines-testing, coroutines-ts, kotlin-android, kotlin-coroutines, kotlin-example, kotlin-examples, kotlin-lang, kotlin-language, kotlin-tutorial, kotlin-tutorials
- Language: Kotlin
- Homepage: https://halilozel1903.medium.com/kotlin-coroutines-nedir-886a8f50010c
- Size: 132 KB
- Stars: 20
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Coroutines-101 ๐งต

A coroutine is a concurrency design pattern that you can use on Android to simplify code that executes asynchronously. Coroutines were added to Kotlin in version 1.3 and are based on established concepts from other languages.
On Android, coroutines help to manage long-running tasks that might otherwise block the main thread and cause your app to become unresponsive. Over 50% of professional developers who use coroutines have reported seeing increased productivity. This topic describes how you can use Kotlin coroutines to address these problems, enabling you to write cleaner and more concise app code.
## Features ๐

Coroutines is our recommended solution for asynchronous programming on Android. Noteworthy features include the following:
1. **Lightweight**: You can run many coroutines on a single thread due to support for suspension, which doesn't block the thread where the coroutine is running. Suspending saves memory over blocking while supporting many concurrent operations.
2. **Fewer memory leaks**: Use structured concurrency to run operations within a scope.
3. **Built-in cancellation support**: Cancellation is propagated automatically through the running coroutine hierarchy.
4. **Jetpack integration**: Many Jetpack libraries include extensions that provide full coroutines support. Some libraries also provide their own coroutine scope that you can use for structured concurrency.## Project Contents ๐
- [CoroutineScope](https://github.com/halilozel1903/Coroutines101/blob/master/app/src/main/java/com/halil/ozel/coroutines101/CoroutineScopeClass.kt)
- [Dispatchers Coroutines](https://github.com/halilozel1903/Coroutines101/blob/master/app/src/main/java/com/halil/ozel/coroutines101/DispatchersCoroutines.kt)
- [GlobalScope](https://github.com/halilozel1903/Coroutines101/blob/master/app/src/main/java/com/halil/ozel/coroutines101/GlobalScopeClass.kt)
- [Nested Coroutines](https://github.com/halilozel1903/Coroutines101/blob/master/app/src/main/java/com/halil/ozel/coroutines101/NestedCoroutines.kt)
- [RunBlocking](https://github.com/halilozel1903/Coroutines101/blob/master/app/src/main/java/com/halil/ozel/coroutines101/RunBlockingClass.kt)
- [Suspend Coroutines](https://github.com/halilozel1903/Coroutines101/blob/master/app/src/main/java/com/halil/ozel/coroutines101/SuspendCoroutines.kt)
- [Coroutines Async](https://github.com/halilozel1903/Coroutines101/blob/master/app/src/main/java/com/halil/ozel/coroutines101/CoroutinesAsync.kt)## Donation ๐ธ
If this project help ๐ you, Can you give me a cup of coffee? โ
[](https://www.buymeacoffee.com/halilozel1903)
## License โน๏ธ
```
MIT LicenseCopyright ยฉ 2022 Halil OZEL
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```