Kotlin pipeline example
Example of a processing pipeline in Kotlin, implemented two different ways:
- Using JVM threads and
BlockingQueue
(packagethreads
) - Using Kotlin coroutines and channels (package
coroutines
)
The pipeline in both cases goes Source -> Filter -> Output, with all three stages containing blocking code.