mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43:09 +00:00
init_all
This commit is contained in:
@@ -244,16 +244,6 @@ local function dispatch_message(prototype, msg, sz, session, source, ...)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function skynet.filter(f ,start)
|
|
||||||
c.callback(function(...)
|
|
||||||
dispatch_message(f(...))
|
|
||||||
end)
|
|
||||||
skynet.timeout(0, function()
|
|
||||||
start()
|
|
||||||
skynet.send(".launcher","lua", nil)
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
function skynet.newservice(name, ...)
|
function skynet.newservice(name, ...)
|
||||||
local handle = skynet.call(".launcher", "lua" , "snlua", name, ...)
|
local handle = skynet.call(".launcher", "lua" , "snlua", name, ...)
|
||||||
return handle
|
return handle
|
||||||
@@ -427,11 +417,27 @@ local function init_all()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function skynet.start(f)
|
local function init_template(start)
|
||||||
|
init_all()
|
||||||
|
init_func = {}
|
||||||
|
start()
|
||||||
|
init_all()
|
||||||
|
end
|
||||||
|
|
||||||
|
function skynet.start(start_func)
|
||||||
c.callback(dispatch_message)
|
c.callback(dispatch_message)
|
||||||
skynet.timeout(0, function()
|
skynet.timeout(0, function()
|
||||||
init_all()
|
init_template(start_func)
|
||||||
f()
|
skynet.send(".launcher","lua", nil)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
function skynet.filter(f ,start_func)
|
||||||
|
c.callback(function(...)
|
||||||
|
dispatch_message(f(...))
|
||||||
|
end)
|
||||||
|
skynet.timeout(0, function()
|
||||||
|
init_template(start_func)
|
||||||
skynet.send(".launcher","lua", nil)
|
skynet.send(".launcher","lua", nil)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user