Implementing State
Machines in Kotlin
Presented by
Prasanna Kumar
Slide 2
Slide 2 text
About me
- Data Engineer @ Kognitiv
- Blog @ https://blog.prassee.me/
- Github - https://github.com/prassee/
- Started Kotlin recently !!!!
Lets begin !!!!
Slide 3
Slide 3 text
Agenda
- Introduction to State Machine
- Modelling a state machine for “Tumbling Window”
- Concurrency in Kotlin - quick tour
- Coroutines
- Channels
- Implementation
- code walk through
- Q&A
Slide 4
Slide 4 text
Introduction to State Machine
Slide 5
Slide 5 text
Modelling a state machine - “Tumbling Window”
https://mapr.com/ebooks/intro-to-apache-flink/chapter-4-handling-time.html
Slide 6
Slide 6 text
Modelling a state machine - “Tumbling Window”
(contd)
Slide 7
Slide 7 text
Coroutine
Concurrency in Kotlin - Coroutines
https://proandroiddev.com/kotlin-coroutines-channels-csp-android-db441400965f
Slide 8
Slide 8 text
suspend fun main() = coroutineScope {
for (i in 0 until 10) {
launch {
delay(1000L - i * 10)
print("❤$i ")
}
}
}
Concurrency in Kotlin - Coroutines
Slide 9
Slide 9 text
Coroutine
Concurrency in Kotlin - Channels
https://proandroiddev.com/kotlin-coroutines-channels-csp-android-db441400965f
Slide 10
Slide 10 text
Show Time !!!
https://github.com/prassee/sm-with-k
otlin