Comparison

util/startup.lua @ 11963:f5c6be4a3ecc

util.startup: Initialize util.async at startup
author Matthew Wild <mwild1@gmail.com>
date Mon, 29 Nov 2021 14:16:20 +0000
parent 11948:dca75cc6fc5a
child 12160:ac654fb19203
comparison
equal deleted inserted replaced
11962:9a70a543c727 11963:f5c6be4a3ecc
398 function startup.init_promise() 398 function startup.init_promise()
399 local promise = require "util.promise"; 399 local promise = require "util.promise";
400 400
401 local timer = require "util.timer"; 401 local timer = require "util.timer";
402 promise.set_nexttick(function(f) return timer.add_task(0, f); end); 402 promise.set_nexttick(function(f) return timer.add_task(0, f); end);
403 end
404
405 function startup.init_async()
406 local async = require "util.async";
407
408 local timer = require "util.timer";
409 async.set_nexttick(function(f) return timer.add_task(0, f); end);
410 async.set_schedule_function(timer.add_task);
403 end 411 end
404 412
405 function startup.init_data_store() 413 function startup.init_data_store()
406 require "core.storagemanager"; 414 require "core.storagemanager";
407 end 415 end
653 startup.read_version(); 661 startup.read_version();
654 startup.log_greeting(); 662 startup.log_greeting();
655 startup.log_startup_warnings(); 663 startup.log_startup_warnings();
656 startup.load_secondary_libraries(); 664 startup.load_secondary_libraries();
657 startup.init_promise(); 665 startup.init_promise();
666 startup.init_async();
658 startup.init_http_client(); 667 startup.init_http_client();
659 startup.init_data_store(); 668 startup.init_data_store();
660 startup.init_global_protection(); 669 startup.init_global_protection();
661 startup.prepare_to_start(); 670 startup.prepare_to_start();
662 startup.notify_started(); 671 startup.notify_started();