mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 12:20:41 +00:00
missing file: fix #661
This commit is contained in:
18
service/service_cell.lua
Normal file
18
service/service_cell.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
local skynet = require "skynet"
|
||||
|
||||
local service_name = (...)
|
||||
local init = {}
|
||||
|
||||
function init.init(code, ...)
|
||||
skynet.dispatch("lua", function() error("No dispatch function") end)
|
||||
skynet.start = function(f) f() end
|
||||
local mainfunc = assert(load(code, service_name))
|
||||
mainfunc(...)
|
||||
skynet.ret()
|
||||
end
|
||||
|
||||
skynet.start(function()
|
||||
skynet.dispatch("lua", function(_,_,cmd,...)
|
||||
init[cmd](...)
|
||||
end)
|
||||
end)
|
||||
Reference in New Issue
Block a user