From: Im still Date: 2009-08-23T01:26:41+09:00 Subject: Re: ruby thread and gets --000feaf10951e5c1a20471bd7254 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Actually, I'm trying to write a command line chatting program. Just for fun. With UDP. And having troubles on controlling (managing ) threads between outputting received msg from other client and getting user typed commands. Because, gets() method seems paused whole program, and if there are messages received from other client will not be displayed automatically.program will stay waiting for user input..... I don't know if I've told things clear enough.... 2009/8/22 Robert Klemme > On 21.08.2009 21:41, Im still wrote: > > Still a question. >> How can I implement a function that command line will keep on outputting >> messages while it will still receive user's keyboard inputtings just like >> Linux shell always does? >> > > Not sure what you mean: the console will happily print whenever something > is sent to it for printing. It seems your question is rather about how to > have work done in background while waiting for user input in the foreground. > I am not sure though whether it is a good idea to clutter the terminal with > output from background jobs when you want to receive typed user input at the > same time. It can be really hard to keep track of what you typed when > background output is copious. > > > Kind regards > > robert > > -- > remember.guy do |as, often| as.you_can - without end > http://blog.rubybestpractices.com/ > > --000feaf10951e5c1a20471bd7254--