mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 03:53:09 +00:00
add bootstrap script
This commit is contained in:
13
service/bootstrap.lua
Normal file
13
service/bootstrap.lua
Normal file
@@ -0,0 +1,13 @@
|
||||
local skynet = require "skynet"
|
||||
|
||||
skynet.start(function()
|
||||
local launcher = assert(skynet.launch("snlua launcher"))
|
||||
skynet.name(".launcher", launcher)
|
||||
|
||||
if skynet.getenv "standalone" then
|
||||
local smgr = assert(skynet.newservice "service_mgr")
|
||||
skynet.name("SERVICE", smgr)
|
||||
end
|
||||
assert(skynet.newservice(skynet.getenv "start" or "main"))
|
||||
skynet.exit()
|
||||
end)
|
||||
Reference in New Issue
Block a user