Changeset

11948:dca75cc6fc5a

util.startup: Integrate util.promise with net.server main loop
author Kim Alvefur <zash@zash.se>
date Sat, 05 Jan 2019 07:15:33 +0100
parents 11947:073e53b72792
children 11949:ae4bc56f18e0
files util/startup.lua
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/util/startup.lua	Sat Jan 05 07:08:24 2019 +0100
+++ b/util/startup.lua	Sat Jan 05 07:15:33 2019 +0100
@@ -395,6 +395,13 @@
 		{ capath = config_ssl.capath, cafile = config_ssl.cafile, verify = "peer", }, https_client);
 end
 
+function startup.init_promise()
+	local promise = require "util.promise";
+
+	local timer = require "util.timer";
+	promise.set_nexttick(function(f) return timer.add_task(0, f); end);
+end
+
 function startup.init_data_store()
 	require "core.storagemanager";
 end
@@ -647,6 +654,7 @@
 	startup.log_greeting();
 	startup.log_startup_warnings();
 	startup.load_secondary_libraries();
+	startup.init_promise();
 	startup.init_http_client();
 	startup.init_data_store();
 	startup.init_global_protection();