midKotlin
What is a suspend function?
Updated May 16, 2026
Short answer
A function that can be paused and resumed in coroutines.
Deep explanation
Suspend functions allow asynchronous execution without blocking threads.
Real-world example
API calls using Retrofit coroutines.
Common mistakes
- Calling suspend functions from non-coroutine context.
Follow-up questions
- Can suspend functions block threads?
- Where are they used?