mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 12:20:41 +00:00
setenv
This commit is contained in:
30
Makefile
30
Makefile
@@ -1,3 +1,5 @@
|
||||
.PHONY : all clean install
|
||||
|
||||
all : \
|
||||
skynet \
|
||||
service/snlua.so \
|
||||
@@ -80,3 +82,31 @@ skynet-master : master/master.c master/main.c
|
||||
clean :
|
||||
rm skynet client skynet-master lualib/*.so service/*.so
|
||||
|
||||
|
||||
$(SKYNET_PATH) :
|
||||
mkdir $@
|
||||
|
||||
install-libs : | $(SKYNET_PATH)
|
||||
cp -R lualib $(SKYNET_PATH)
|
||||
|
||||
install-bins : | $(SKYNET_PATH)
|
||||
cp skynet $(SKYNET_PATH)
|
||||
|
||||
$(SKYNET_PATH)/service : | $(SKYNET_PATH)
|
||||
mkdir $@
|
||||
|
||||
install-services : | $(SKYNET_PATH)/service
|
||||
cp service/connection.so $(SKYNET_PATH)/service/
|
||||
cp service/logger.so $(SKYNET_PATH)/service/
|
||||
cp service/gate.so $(SKYNET_PATH)/service/
|
||||
cp service/broker.so $(SKYNET_PATH)/service/
|
||||
cp service/snlua.so $(SKYNET_PATH)/service/
|
||||
cp service/client.so $(SKYNET_PATH)/service/
|
||||
cp service/launcher.lua $(SKYNET_PATH)/service/
|
||||
cp service/redis-cli.lua $(SKYNET_PATH)/service/
|
||||
|
||||
|
||||
install : install-libs install-bins install-services
|
||||
|
||||
|
||||
|
||||
6
config
6
config
@@ -1,10 +1,12 @@
|
||||
root = "./"
|
||||
thread = 8
|
||||
mqueue = 256
|
||||
cpath = "./service/?.so"
|
||||
logger = nil
|
||||
harbor = 1
|
||||
address = "tcp://127.0.0.1:2525"
|
||||
master = "tcp://127.0.0.1:2012"
|
||||
start = "main"
|
||||
standalone = true
|
||||
luaservice = "./service/?.lua"
|
||||
luaservice = root.."service/?.lua"
|
||||
cpath = root.."service/?.so"
|
||||
protopath = root.."proto"
|
||||
|
||||
@@ -69,6 +69,14 @@ function skynet.kill(name)
|
||||
c.command("KILL",name)
|
||||
end
|
||||
|
||||
function skynet.getenv(key)
|
||||
return c.command("GETENV",key)
|
||||
end
|
||||
|
||||
function skynet.setenv(key, value)
|
||||
c.command("SETENV",key .. " " ..value)
|
||||
end
|
||||
|
||||
skynet.send = c.send
|
||||
skynet.pack = c.pack
|
||||
skynet.tostring = c.tostring
|
||||
|
||||
Reference in New Issue
Block a user