--- deliantra/server/ext/map-scheduler.ext 2007/01/05 19:12:01 1.16 +++ deliantra/server/ext/map-scheduler.ext 2007/01/05 21:51:41 1.18 @@ -2,6 +2,7 @@ # this extension swaps out maps and resets them, in essence managing # the reset/swap policy of the server. +# it also contains the map prefetching logic our $DEACTIVATE_TIMEOUT = 20; # number of seconds after which maps get deactivated to save cpu our $SWAP_TIMEOUT = 35; # number of seconds after which maps inactive get swapped out @@ -9,7 +10,7 @@ our $SAVE_TIMEOUT = 20; # save maps every n seconds our $SAVE_INTERVAL = 0.1; # save at max. one map every $SAVE_INTERVAL -cf::coro { +cf::async_ext { $Coro::current->prio (Coro::PRIO_MIN); # load the header of swapped-out maps. # this is not a correctness issue, it simply saves diskspace @@ -29,7 +30,7 @@ #TODO: should also preload random maps... }; -our $SCHEDULER = cf::coro { +our $SCHEDULER = cf::async_ext { while () { Coro::Timer::sleep $SCHEDULE_INTERVAL; @@ -75,7 +76,7 @@ on_enter => sub { my ($map, $pl) = @_; - (Coro::async_pool { + (cf::async { my @diag; # diagonal neighbours for (0 .. 3) {