mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43:09 +00:00
setenv
This commit is contained in:
30
Makefile
30
Makefile
@@ -1,3 +1,5 @@
|
|||||||
|
.PHONY : all clean install
|
||||||
|
|
||||||
all : \
|
all : \
|
||||||
skynet \
|
skynet \
|
||||||
service/snlua.so \
|
service/snlua.so \
|
||||||
@@ -80,3 +82,31 @@ skynet-master : master/master.c master/main.c
|
|||||||
clean :
|
clean :
|
||||||
rm skynet client skynet-master lualib/*.so service/*.so
|
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
|
thread = 8
|
||||||
mqueue = 256
|
mqueue = 256
|
||||||
cpath = "./service/?.so"
|
|
||||||
logger = nil
|
logger = nil
|
||||||
harbor = 1
|
harbor = 1
|
||||||
address = "tcp://127.0.0.1:2525"
|
address = "tcp://127.0.0.1:2525"
|
||||||
master = "tcp://127.0.0.1:2012"
|
master = "tcp://127.0.0.1:2012"
|
||||||
start = "main"
|
start = "main"
|
||||||
standalone = true
|
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)
|
c.command("KILL",name)
|
||||||
end
|
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.send = c.send
|
||||||
skynet.pack = c.pack
|
skynet.pack = c.pack
|
||||||
skynet.tostring = c.tostring
|
skynet.tostring = c.tostring
|
||||||
|
|||||||
Reference in New Issue
Block a user