libgo icon indicating copy to clipboard operation
libgo copied to clipboard

是否有类似golang select的用法?

Open maoshigui opened this issue 5 years ago • 2 comments

libgo 是否支持golang中select在多个channel中选择的的用法?如果不支持,是否有类似计划?

select { case ch <- 42: foo() case i := <- ch: bar(i) default: baz() }

maoshigui avatar May 15 '19 15:05 maoshigui

有同样需求。在我的phpgo项目中使用TryPush/TryPop 加轮询替代,在case数量不多的情况下,性能并没有特别下降。在case比较多的情况下,内置支持效率会更高。

birdwyx avatar Jun 26 '19 04:06 birdwyx

TimedPush

yyzybb537 avatar Jun 26 '19 06:06 yyzybb537