… | |
… | |
8 | |
8 | |
9 | our %follow; |
9 | our %follow; |
10 | |
10 | |
11 | our $CORO = cf::async { |
11 | our $CORO = cf::async { |
12 | $Coro::current->{desc} = "follow handler"; |
12 | $Coro::current->{desc} = "follow handler"; |
|
|
13 | |
|
|
14 | while () { eval {#d# |
13 | |
15 | |
14 | while () { |
16 | while () { |
15 | cf::wait_for_tick; |
17 | cf::wait_for_tick; |
16 | |
18 | |
17 | while (my ($name, $v) = each %follow) { |
19 | while (my ($name, $v) = each %follow) { |
… | |
… | |
46 | } |
48 | } |
47 | } |
49 | } |
48 | |
50 | |
49 | Coro::schedule unless keys %follow; |
51 | Coro::schedule unless keys %follow; |
50 | } |
52 | } |
|
|
53 | }; warn "follow handler died <$@>\n"; }#d# |
51 | }; |
54 | }; |
52 | |
55 | |
53 | cf::register_command follow => sub { |
56 | cf::register_command follow => sub { |
54 | my ($who, $args) = @_; |
57 | my ($who, $args) = @_; |
55 | |
58 | |