mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
add lua loader
This commit is contained in:
@@ -5,10 +5,11 @@ skynet.start(function()
|
||||
skynet.name(".launcher", launcher)
|
||||
|
||||
if skynet.getenv "standalone" then
|
||||
local datacenter = assert(skynet.newservice "datacenter")
|
||||
local datacenter = assert(skynet.newservice "datacenterd")
|
||||
skynet.name("DATACENTER", datacenter)
|
||||
local smgr = assert(skynet.newservice "service_mgr")
|
||||
end
|
||||
skynet.uniqueservice("multicastd")
|
||||
assert(skynet.newservice(skynet.getenv "start" or "main"))
|
||||
skynet.exit()
|
||||
end)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
local skynet = require "skynet"
|
||||
local mc = require "multicast.c"
|
||||
local datacenter = require "datacenter"
|
||||
|
||||
local command = {}
|
||||
local channel = {}
|
||||
@@ -49,4 +50,8 @@ skynet.start(function()
|
||||
local f = assert(command[cmd])
|
||||
skynet.ret(skynet.pack(f(source, ...)))
|
||||
end)
|
||||
local self = skynet.self()
|
||||
local id = skynet.harbor(self)
|
||||
assert(datacenter.set("multicast", id, self) == nil)
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user