mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 19:13:07 +00:00
22 lines
287 B
Lua
22 lines
287 B
Lua
local skynet = require "skynet"
|
|
|
|
local service = {}
|
|
local root = {}
|
|
|
|
function root.register(name, obj)
|
|
service[name] = obj
|
|
end
|
|
|
|
function root.query(name)
|
|
return service[name]
|
|
end
|
|
|
|
function root.echo(hello)
|
|
return hello
|
|
end
|
|
|
|
skynet.remote_create(root,0)
|
|
|
|
skynet.start(function() end)
|
|
|