开发者

Two loops simultaneously?

How would I run two loop do ... end simultaneously in Ruby? One would be for CLI interface and the other would开发者_如何转开发 be for background processing.


Sounds like you want two threads.


You can use yield to create co-routines

Generators like Ruby's can be 'abused' to create coroutines. I don't speak Ruby but I could outline the concept in C# or Python.

It also appears like something was added in Ruby 1.9 to make this easier

Cheers

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜