how to implement timeout on vista

L

Li Chen

Hi all,

I am sorry if this post is duplicated.


Here is what I try to do: get input from terminal/console. If waiting
for 3 seconds and no input is given, then stop this process and print
out a message of 'Timeout!!!'

I tried 'timeout' from the library but it doesn't work.I wonder how I
implement timeout process on vista.

Thank you very much in advance,

Li
 
A

ara.t.howard

Hi all,

I am sorry if this post is duplicated.


Here is what I try to do: get input from terminal/console. If waiting
for 3 seconds and no input is given, then stop this process and print
out a message of 'Timeout!!!'

I tried 'timeout' from the library but it doesn't work.I wonder how I
implement timeout process on vista.

Thank you very much in advance,

Li



gem install terminator

http://codeforpeople.com/lib/ruby/terminator/terminator-0.4.2/README

cheers.

a @ http://codeforpeople.com/
 
L

Li Chen

Ara said:

Thanks.

I try terminator on my PC with Vista. I don't think it works. If I put
'input=gets' and without giving the input it will hang there for ever.

Li

#################1
C:\Users\Alex>irb
irb(main):001:0> require 'terminator'
=> true
irb(main):002:0> Terminator.terminate 1 do
irb(main):003:1* sleep 4 rescue puts 'timeout'
irb(main):004:1> end
=> 2456

################ I have to use Ctrl+break to stop the script after 2 min
were passed.

C:\Users\Alex>irb
irb(main):001:0> require 'terminator'
=> true
irb(main):002:0> Terminator.terminate 1 do
irb(main):003:1* input=gets
irb(main):004:1> sleep 4 rescue puts 'timeout'
irb(main):005:1> end
2 min pased
=> 2708
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,830
Latest member
ZADIva7383

Latest Threads

Top