mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-23 19:43:09 +00:00
redis api back compatible
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user