강의

멘토링

커뮤니티

Programming

/

Back-end

Practical Kotlin Coroutine Master Class: Close to Fundamentals and True to Basics

This course is a master class that teaches Kotlin's 🌺 Coroutine, covering everything from theoretical foundations to practical application in a standard manner. It systematically covers core principles and structure, the necessity of asynchronous programming, Coroutine builders and scopes, exception handling, channels, Flow, and other key features frequently used in practice, step by step. Each concept is explained with hands-on examples, making it easy for beginners to understand and immediately apply them. This is the best introductory and practical course for developers who want to build strong Coroutine skills for real-world use.

(4.9) 11 reviews

87 learners

  • Hong
코틀린
코루틴
Android
Kotlin
concurrent
backend
coroutine

Reviews from Early Learners

What you will gain after the course

  • Minimum Basic Kotlin Syntax

  • Advantages and disadvantages of multi-threading, and accordingly, how to utilize coroutines

  • Structured Concurrency and Practical Patterns in Coroutines

  • From Basic to Advanced Exception Handling Methods in Coroutines

  • Management of Shared Resources in Parallel Programming

  • Method for Streaming Event Data Using Flow

  • Shared resource management between lightweight threads using Channels

Coroutines introduced by developers of large companies based on the classics

There is no longer a need for lectures that simply teach the operating principles of coroutines. Experience various cases and practical codes that can be used immediately in practice that actual developers at large companies have encountered and applied in the field through this lecture.


This lecture covers the basic concepts of coroutines, as well as tools that are widely used in practice, such as Flow, Channel, Dispatcher, and Scope, with examples. You can learn naturally through practical function implementation examples, from simple API calls to complex asynchronous logic, child-parent relationships, job management, and even exception handling.


While many materials remain theoretical, this lecture aims to properly inform you of 'why it should be written this way' , 'where problems arise' , and 'how to solve them' in a practical development environment.

We will not just end with theory, but will teach you technologies that can be applied to actual services, patterns and know-how actually used by practitioners, and writing methods that avoid mistakes.

Why should I learn coroutines?

It makes no sense to learn coroutines simply because they are “asynchronous processing” or because they are a “trend.”

The realistic reason why you need to know coroutines is "practical efficiency" and "competitiveness".


When working, there are many tasks that take a long time, such as API calls, DB transactions, and external system connections.

If we try to handle all of this with threads, resources are limited, and if we configure it with callbacks, it is difficult to manage.

Coroutines are used in various ways, not limited to Android and backend.. RxJava, callback hell, complex synchronization issues... Those who have already experienced it will have felt firsthand, "This is why coroutines are needed."

📚 Complex asynchronous logic can be made as simple as synchronous code

In the past, if you wanted to process multiple tasks asynchronously, you had to use various techniques such as callbacks, threads, and Futures. However, this method made the code complicated, and with just one 'suspend' keyword, you can mix asynchronous and synchronous tasks, greatly improving readability and maintainability.

📚 Maximize server resource efficiency

If you create multiple threads to handle concurrency, server resources can quickly be exhausted and performance can deteriorate. Coroutines handle thousands to tens of thousands of tasks with a small number of threads, so you can efficiently utilize server resources. For example, when handling large numbers of network requests or data input/output concurrently, it can handle many more requests than thread-based.

📚 Manage safely with structured concurrency

Coroutines manage the lifecycle of tasks in a parent-child relationship. When the parent coroutine terminates, the child coroutine is automatically cleaned up, preventing resource leaks or unexpected behavior. This structured concurrency enables predictable behavior and stable server operation even in large-scale services.

📚 Intuitive error handling and cancellation

When an exception occurs in asynchronous code, it is often difficult to know where and how to handle it. Coroutines provide consistent support for exception propagation, error handling, and task cancellation (cancellation tokens, etc.). It allows you to handle error situations commonly encountered in practice much more simply and safely.

📚 Real-time data streams and event processing

By utilizing Flow and Channel of coroutine, Processing complex events such as real-time data streams, chats, sensor data, and real-time notifications It can be implemented with concise and readable code. Instead of attaching a callback every time an event occurs, Flow allows you to work with data declaratively and reactively.

After taking the lecture, you can create results like this.

Asynchronous processing code that can be applied directly to practice

It allows you to write narrow asynchronous flows as concisely as synchronous code.

Create reliable and efficient coroutine-based code that can be used in real-world services right away, without callback hell or complex thread management!

Designing a Structured Concurrency Architecture

You can incorporate the Structured Concurrency pattern into your project, which safely manages multiple asynchronous tasks in a parent-child relationship, rather than just a single task.

Through this, you will learn how to handle large volumes of traffic or complex data flows reliably.

Real-time data stream and event processing system

Leverage Coroutine's unique tools, such as Flow and Channel, to implement essential features found in various event-based systems, such as chat, data pipelines, and log analyzers!

Stable exception and cancellation handling

Let's learn how to safely handle common errors, exception propagation, and task cancellation issues that we frequently encounter in practice by writing practical code using coroutines!

Easy to maintain, readable code

We provide a clean and consistent code style that allows you to understand even complex asynchronous/concurrent logic at a glance. With this, you can develop the skills essential for practical work such as collaboration with team members, code review, and feature expansion!

Learning using about 30 practical example codes

This course is not a lecture that consists solely of theory or words, but is prepared as a course in which you learn by implementing simple or advanced functions.

Four Values That Knowledge Sharers Value

1. Lectures must be humane.

I don't think a lecture that is easy to show is a lecture, even if it is considered unprofessional. Debugging time is also part of the lecture.

2. It must be specialized for practical work.

Development is not something you just talk about. You can actually implement it and go through the process of making it work.

  • Planners... please save me...


3. It must be helpful to students.

I wanted to incorporate concepts that I have applied and seen effective in my field. Through this process, you can indirectly experience the field, or if you are a practitioner, you can demonstrate better performance in the field environment.

4. The lecture is not over.

I hope you leave many questions and answers as you go through the lecture. This lecture was not created solely based on my knowledge. It also includes opinions from developers at various large companies.

  • Here are some brief biographies of those who helped in completing this lecture:

private val supported_one = "Kakao Pay Platform Backend Developer" private val supported_two = "Toss Securities API Server Developer" private val supported_three = "Unicorn startup developer who asked to keep it a secret"

Lecture Structure

📚 Section 1

Along with the introduction to the lecture, I would like to compare and explain the differences between lightweight threads that you can easily use, such as coroutines, and threads that are managed by the OS and allocated with resources.

print ( "⚠️ Important points that Kakao Pay platform backend developers think about!! ⚠️" ) You can develop without knowing the difference between threads and lightweight threads. However, if you are preparing for a job change or employment, this is a great topic to prepare for an interview! It is a simple content, but you can learn the simple content right away through this time!

📚 Section 2

We'll go over some very basic coroutine declarations and working code. It's a very basic topic, and we're providing it to you as a warm-up.

📚 Section 3

You will learn how to manage the life cycle of a coroutine. You will learn about various real-world examples of coroutine cancellation and Gracefully Shut Down, and manage events related to coroutine cancellation!

📚 Section 4

In using concurrent programming, you will implement an explicit code form that returns and uses values. In addition, we have prepared a time for you to understand and learn the basic coroutine structure called parent-child relationship!

📚 Section 5

This is a time to theoretically understand the Dispatcher and Context used inside coroutines and learn by applying various Dispatchers. It is not required!! But I prepared it as a time to know for optimization.

📚 Section 6

Is the parent-child relationship in coroutines always consistent? We have prepared various topics, from life cycle management through practical patterns to how to break the consistency of parent-child relationships in coroutines.

📚 Section 7

You will start learning about Flow. In this section, rather than just covering the theoretical part, you will learn by actually creating code, functions, or services that can be used in practice. This lecture covers asynchronous streams with reference to the largest practical example.

print ( "⚠️ Important points that Unicorn startup developers think about!! ⚠️" ) I think this is a must-have topic for working on big data streams for DB or processing general log data. There are some parts where the example code suddenly becomes difficult, but we prepared it so that you can handle it more enjoyably. If you chew on it and understand it and learn it, it will be of great help!

📚 Section 8

How do you communicate between coroutines? In concurrent programming, when you need to transfer data between systems that operate in parallel, or additionally transfer and process event-based data, or create a resource that shares data between lightweight threads!! You will learn about Channels that can handle various cases like these.

print ( "⚠️ Important points from a server developer who films lectures and develops platforms in Pangyo ⚠️" ) The act of guaranteeing data transfer between lightweight threads atomicly is very widely used. I hope that you will have time to implement channels in Kotlin in the same way as in Golang and manage data sharing resources in parallel programming together and get more immersed in coroutines.

📚 Section 9

How important is exception handling in Kotlin? It is a must-have item to prevent OOM caused by resource leaks. In this section, we will dive deeper into exception handling and prepare to create a more robust system!

📚 Section 10

The most important part of concurrent programming is control over shared resources. If you ignore this part, it is easy to encounter really dangerous situations such as Race Condition and Dead Lock. In this lesson, you will learn representative techniques to solve these problems.

print ( "⚠️ Important points that Toss developers think about ⚠️" ) When implementing functions for bank accounts and withdrawal services, access control to these shared resources is a very important topic. In this lecture, I personally consider this to be the most important topic, and even if it is not a coroutine, it is necessary to introduce, consider, and use this topic in general programming. As this is the last section, I think it is a very important topic, so I hope you will focus and learn it well.

Kotlin Masterclass through Time Capsule Project Practice

  • This is a Kotlin master class lecture that builds web services using Ktor, JetBrains' largest open source. Through this lecture, you will learn about Kotlin's basic grammar and practical encryption methods.

Kotlin Master Class: Learning through Bank Server Project Practice

  • You can learn everything about data processing methods, DB considerations, and how to utilize event-based data according to traffic type, using polyglot persistence strategies and Kafka, etc.

Things to note before taking the class

Practice environment

  • Taken using MacOS M3.


  • java --version : 17.0.12 2024-07-16 LTS

  • I use an IDE from the JetBrains family.

  • Build using Gradle.

  • It doesn't cover infrastructure.

Recommended for
these people

Who is this course right for?

  • Someone who wants to learn the coroutine concept properly

  • Learn Coroutines via practical examples

  • Those wanting to design/debug complex coroutine structures

  • Those interested in performance optimization and parallel processing

  • Kotlin-based backend and mobile developer

  • Backend/Mobile Developer interested in Kotlin on Spring

Hello
This is

4,587

Learners

334

Reviews

118

Answers

4.7

Rating

18

Courses

자기 소개

집에서 빈둥대다 개발에 흥미를 느껴 개발 공부를 시작하였고 현재는 판교에서 플랫폼 서버 개발을 담당하여 진행하고 있습니다.

 

제가 공부를 했던 방법과 실무에서 접하실 수 있는 여러가지 문제점들과 해결책을 여러분들에게 제공하고 싶어 지식공유자 활동을 이어나가고 있습니다.

 

강의는 오로지 저만의 지식을 통해 만들어지지 않습니다. 모든 강의는 함께하시는 분들이 계십니다.

 

지식공유자 경력

[前] 샌드박스IP 관련 블록체인 개발자

[前] 메타버스 백엔드 개발자

[] 판교에서 고여가는 서버 개발자

 

인터뷰 이력

Curriculum

All

37 lectures ∙ (5hr 9min)

Course Materials:

Lecture resources
Published: 
Last updated: 

Reviews

All

11 reviews

4.9

11 reviews

  • 미래 1인 개발자님의 프로필 이미지
    미래 1인 개발자

    Reviews 8

    Average Rating 5.0

    5

    32% enrolled

    강의에 함께 참여하여 촬영하는데에 도움을 준 토스에서 개발하고 있는 개발자 입니다. 이 강의를 준비하면서 꽤나 많은 부분을 고민하였습니다. 아무래도 경량 쓰레드라는 주제가 쉽지 않은 주제이기도 했고, 어떤 식으로 다루어야 하는지도 고민을 하였습니다. 하지만 강의 촬영해주시는 분의 의견에 따라서 최대한 다양한 예제를 제공해드리며, 짜임새 있는 강의보다는 친숙한 강의가 되자는 목표를 가지고 진행하였습니다. 그만큼 단점도 있는 방식이지만 장점도 있는 방식이라고 생각을 합니다. 이 강의가 여러분들에게 완벽하게 코루틴을 사용하는 사람을 만들어드리지는 못합니다. 어디까지나 강의이기 때문입니다. 이 강의를 기준으로 다양하게 실제로 활용해보시면 완벽하게 코루틴을 사용하는 사람이 되실 수 있지 않을까 싶습니다. 이 강의가 여러분들을 만족시키지 못한다면, 부족한 만큼 많이 배우고 개선하고자 하는 의지가 있으니 피드백 해주시면 감사하겠습니다.

    • 이정현님의 프로필 이미지
      이정현

      Reviews 3

      Average Rating 5.0

      5

      32% enrolled

      • Hoos님의 프로필 이미지
        Hoos

        Reviews 10

        Average Rating 5.0

        5

        97% enrolled

        Kotlin도 알고 싶고 Coroutine도 알고 싶다?? 그냥 이걸 참고해가면서 공부하면 가장 좋은 학습 방법이 아닐까 싶습니다. 감사합니다.

        • Hong
          Instructor

          안녕하세요 Hoos님 좋은 평 남겨주셔서 감사합니다!! 앞으로 더 좋은 강의로 찾아 뵙도록 할게요!! 좋은 하루 보내세요!!

      • 개발 잘하고 싶다...님의 프로필 이미지
        개발 잘하고 싶다...

        Reviews 7

        Average Rating 5.0

        5

        95% enrolled

        다양한 주제로 재미있게 잘 봤습니다. 많은 도움이 되었네요. 감사합니다.

        • Hong
          Instructor

          안녕하세요 개발 잘하고 싶다님 좋은 평 남겨주셔서 감사합니다!! 앞으로 더 좋은 강의로 찾아 뵙도록 할게요!! 좋은 하루 보내세요!!

      • 최병현님의 프로필 이미지
        최병현

        Reviews 4

        Average Rating 5.0

        5

        62% enrolled

        • Hong
          Instructor

          안녕하세요 최병현님 평 남겨주셔서 감사합니다. 앞으로 더 좋은 강의로 찾아뵙도록 하겠습니다! 좋은 하루 보내세요!

      $53.90

      Hong's other courses

      Check out other courses by the instructor!

      Similar courses

      Explore other courses in the same field!