On Mon, Sep 19, 2011 at 4:03 PM, Sub Zero <zhoran / inbox.ru> wrote:
> Hi,
> Would you be so kind to advise me Player.get_action() implementation?
> It should return value within timeout regardless of @connection
> troubles.
>
> class Player
>
>   >  
>  >    
>  
>
>   
>  what should be here ???
>  
>
> end
>
>
> action = Player.new( "Peter" ).get_action :fold, 30
>
> Thank you inadvance!

10:00:52 Temp$ irb19
Ruby version 1.9.2
irb(main):001:0> require 'timeout'
=> true
irb(main):002:0> timeout(10) { puts 123 }
123
=> nil
irb(main):003:0> timeout(10) { sleep 11; puts 123 }
Timeout::Error: execution expired
        from (irb):3:in `sleep'
        from (irb):3:in `block in irb_binding'
        from (irb):3
        from /opt/bin/irb19:12:in `<main>'

Kind regards

robert


-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/