Anyone have a simple implementation for a suspendi...
# coroutines
l
Anyone have a simple implementation for a suspending CountDownLatch?
g
What is your case for this? Maybe existing suspend Semaphore or other primitive will work for you
l
I have a suspending connect function and after I connect and send credentials I want to suspend until I received a success but this happens in a generic data handler which will unlatch
separate from the connect function
m
Semaphore can work there
l
thank you looking at docs now
g
Also if you have only one lock just use suspend Mutex
Also standard fan-in/fan-out pattern will work, but probably it requires quite different structure of code on your sidd
d
Also coroutineScope can solve many of the concerns of CDL though maybe not this specific one