You are currently viewing Is There a Coroutine Equivalent of Of Using a Blocking Queue for Asynchronous Tasks?

Is There a Coroutine Equivalent of Of Using a Blocking Queue for Asynchronous Tasks?

So a pattern I have used in Java (and am thinking about using in a Kotlin app I’m working on) leverages BlockingQueues. It’s a common pattern, you have a BlockingQueue into which you place items (in this case, it’s data to persist), and then there’s a special thread always waiting on that queue to do an action with its contents.

I’m only just starting to get into coroutines, and I’m wondering if there is an idiomatic coroutine approach to accomplishing this?

submitted by /u/Droid2Win
[link] [comments]