… | |
… | |
30 | |
30 | |
31 | #TODO: should also preload random maps... |
31 | #TODO: should also preload random maps... |
32 | }; |
32 | }; |
33 | |
33 | |
34 | our $SCHEDULER = cf::async_ext { |
34 | our $SCHEDULER = cf::async_ext { |
35 | my $schedule_interval = Coro::Event->timer (after => 1, interval => $SCHEDULE_INTERVAL); |
|
|
36 | while () { |
35 | while () { |
37 | $schedule_interval->next unless cf::object::actives_size > $MAX_ACTIVES; |
36 | Coro::Event::do_timer (after => $SCHEDULE_INTERVAL); |
38 | |
37 | |
39 | # this weird form of iteration over values is used because |
38 | # this weird form of iteration over values is used because |
40 | # the hash changes underneath us frequently, and for |
39 | # the hash changes underneath us frequently, and for |
41 | # keeps a direct reference to the value without (in 5.8 perls) |
40 | # keeps a direct reference to the value without (in 5.8 perls) |
42 | # keeping a reference, so this is prone to crashes or worse. |
41 | # keeping a reference, so this is prone to crashes or worse. |