Alexander Vtyurin
06/26/2019, 8:03 PMwhile
loop instead of this?
while (condition) {
...
delay(1)
}
streetsofboston
06/26/2019, 8:06 PMAlexander Vtyurin
06/26/2019, 8:11 PMgetFromQueue
that in loop tries to get something from a concurrent queue until there is something. If there is nothing it tries again.
I've just figured out I can do a generator instead of getFromQueue
.streetsofboston
06/26/2019, 8:13 PMdelay(....)
or yield()
.Alexander Vtyurin
06/26/2019, 8:14 PMDico
06/27/2019, 12:55 AMefemoney
06/27/2019, 2:50 AMChannel
is somewhat analogous to your “blocking queue”Dico
06/27/2019, 9:54 AMAlexander Vtyurin
06/27/2019, 1:07 PMYou can also use channel instead of queueGreat stuff.