redis api back compatible

This commit is contained in:
云风
2013-06-21 16:09:52 +08:00
parent 277b6957cb
commit d8204357a8
4 changed files with 29 additions and 10 deletions

View File

@@ -1,15 +1,21 @@
local skynet = require "skynet"
local socket = require "socket"
skynet.start(function()
local function console_main_loop()
local stdin = socket.stdin()
socket.lock(stdin)
while true do
local cmdline = socket.readline(stdin, "\n")
local handle = skynet.newservice(cmdline)
if handle == nil then
print("Launch error:",cmdline)
if cmdline ~= "" then
local handle = skynet.newservice(cmdline)
if handle == nil then
print("Launch error:",cmdline)
end
end
end
socket.unlock(stdin)
end
skynet.start(function()
skynet.fork(console_main_loop)
end)