SupportWriter space ↗
A JOURNAL ABOUT TECHNOLOGY

Learn something new.
Write. Share.

A space to connect knowledge, one line of code a day.
Discover tutorials, ideas, and notes from a learning journey.

1967 notes & counting ↙
EDITOR’S PICK ↗
Pentesting

Planning Your First Web Application Pentest: Scope, Safety, and Evidence

Build a focused web pentest plan with clear authorization, realistic objectives, controlled testing, and evidence that developers can use.

D Putu Adi Guna Permana · 3 min read
FOR YOUR CURIOSITY

Latest notes.

KOTLIN / NOTES</>↗
Kotlin03 Jul 2026

How do I understand the coroutine lifecycle in Kotlin?

Kotlin coroutine lifecycle: the mental model A Kotlin coroutine is a lightweight concurrent task that runs inside a CoroutineScope and is controlled by a Job. The lifecycle is mostly about the state of that Job. At a high level: New → Active → Completing → Completed ↘ Cancelling → Cancelled Most of the time, you […]

Wayan · 6 min read
KOTLIN / NOTES</>↗
Kotlin03 Jul 2026

How do I cancel a coroutine in Kotlin safely?

In Kotlin, you cancel a coroutine safely by calling cancel() on its Job or scope, and making sure the coroutine code is cooperative: it should suspend regularly or check for cancellation. Basic example import kotlinx.coroutines.* fun main() = runBlocking { val job = launch { try { repeat(1_000) { i -> println("Working $i") delay(500) // […]

Wayan · 2 min read
KOTLIN / NOTES</>↗
Kotlin03 Jul 2026

How do I run coroutines in parallel using async and await in Kotlin?

In Kotlin, use async to start concurrent work inside a coroutine scope, then call await() to get each result. Basic example: import kotlinx.coroutines.* suspend fun fetchUser(): String { delay(1000) return "User" } suspend fun fetchPosts(): List<String> { delay(1000) return listOf("Post 1", "Post 2") } fun main() = runBlocking { val userDeferred = async { fetchUser() […]

Wayan · 2 min read
KOTLIN / NOTES</>↗
Kotlin03 Jul 2026

How do I write a suspend function in Kotlin?

In Kotlin, a suspend function is declared with the suspend modifier. suspend fun fetchUser(): User { // Can call other suspend functions here return api.getUser() } A suspend function can pause without blocking the thread and later resume. It is commonly used with coroutines for asynchronous work. Example: import kotlinx.coroutines.delay import kotlinx.coroutines.runBlocking suspend fun greetAfterDelay() […]

Wayan · 1 min read
KOTLIN / NOTES</>↗
Kotlin03 Jul 2026

How do I use delay instead of Thread.sleep in Kotlin coroutines?

Use kotlinx.coroutines.delay(…) inside a coroutine instead of Thread.sleep(…). Thread.sleep blocks the current thread. delay suspends the coroutine without blocking the thread, so other coroutines can keep running. import kotlinx.coroutines.delay import kotlinx.coroutines.runBlocking fun main() = runBlocking { println("Before delay") delay(1_000) // suspends for 1 second, does not block the thread println("After delay") } If you currently […]

Wayan · 1 min read
KOTLIN / NOTES</>↗
Kotlin03 Jul 2026

How do I launch a coroutine in Kotlin using launch and runBlocking?

In Kotlin, you can use runBlocking to start a coroutine scope that blocks the current thread until its coroutines finish, and launch to start a new coroutine inside that scope. import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking fun main() = runBlocking { launch { println("Coroutine is running") } println("Main coroutine continues") } Output may look like: Main coroutine […]

Wayan · 1 min read
✳

Knowledge grows when shared.

Stay curious. There is always something new to learn.

Explore notes ↗
Putu Adi Guna Permana
ABOUT THE AUTHOR

Dr (C). Ir. Putu Adi Guna Permana, S.Kom., M.Kom., IPM., ASEAN Eng.

Writer and founder of Diary Coding — sharing notes, tutorials, and experiences about programming for anyone who wants to keep learning.