ããå¦çãããã¨ãã«ä¸å®ä»¥ä¸ã®æéããã£ããtimeoutãã¦å¦çãçµããããã¿ãããªãã¨ããããæããã¾ã«ããã®ã§ããããè¡ãSub::Timeoutã¨ããã¢ã¸ã¥ã¼ã«ãä½ãã¾ããã https://github.com/shibayu36/p5-Sub-Timeout 使ãæ¹ use Sub::Timeout; use HTTP::Tiny; my $res = timeout 3.5, sub { HTTP::Tiny->new->get('http://example.com/foo'); }; åºæ¬çã«ã¯ä¸ã®ããã«ãã¿ã¤ã ã¢ã¦ããããç§æ°ã¨å¦çã®coderefã渡ãã¾ãã ä¸ã®ä¾ã ã¨3.5ç§éã§å¦çãçµãã£ãå ´åããã®è¿ãå¤ã$resã¨ãã¦è¿ããå¦çãçµãããªãã£ãå ´åããã®æç¹ã§å¦çãæã¡åã£ã¦ä¾å¤ãæããããã«ãã¦ãã¾ããä¾å¤ãæããã®ã§ãã®å¾ãå¦çãç¶ãããå ´åã¯ä¾å¤å¦çãã
{{#tags}}- {{label}}
{{/tags}}