ããã«ã¡ã¯ãhiratara ã§ããã¿ãªãããæèã¯é«ã¾ã£ã¦ãã¾ããï¼ ç§ã¯ä¸ã ã§ããä»åã¯æä½ã® Data::Monad::CondVar ã¨ããã¢ã¸ã¥ã¼ã«ãç´¹ä»ããã¦é ãã¾ãã ã¢ã¸ã¥ã¼ã«åã«Monad ã¨ããNGã¯ã¼ããå ¥ã£ã¦ãã¾ããããã®ã¢ã¸ã¥ã¼ã«ã¯AnyEvent ç¨ã®JSDeferred ã§ããJSDeferred ã¯ã¿ãªãã好ãã§ããï¼ å«ããªäººã¯å¥½ãã«ãªãã¾ã§ä½åº¦ãç¹°ãè¿ã使ã£ã¦å¥½ãã«ãªãã°ããã¨æãã¾ãã ã³ã¼ã«ããã¯æ¹å¼ã®é¢æ°ãé ã«å¼ã³åºãå ´åãä¸è¬ã«è¨è¿°ããã¹ããã¾ãã use AnyEvent; sub add1($$) { my ($n, $cb) = @_; my $t; $t = AE::timer 1, 0, sub { $cb->($n + 1); undef $t; }; } my $cv = AE::cv; add1 0 => sub { my $n
{{#tags}}- {{label}}
{{/tags}}