hey, i was just wondering, is there a way to tell ...
# coroutines
w
hey, i was just wondering, is there a way to tell two separate coroutines to wait a specific time before continuing without having to cancelling them and then relaunching once both coroutines are done
e
do you want something like a rendezvous barrier? https://en.wikipedia.org/wiki/Barrier_(computer_science)
I don't think there's anything like this built-in but it's not difficult to make https://pl.kotl.in/TrH0zzsfI
w
thanks so much this is exactly what i was looking for!
e
Coroutines are cheap. Usually, you don’t need things like barriers that you have to use with (expensive) threads. Instead of having two coroutines to wait on a barrier you can simply launch two new coroutines after delay or whatever other action you were doing.