bugfix: timeout

This commit is contained in:
云风
2012-08-13 23:28:23 +08:00
parent 2f21ccb72a
commit ce1b5046c6
2 changed files with 23 additions and 5 deletions

View File

@@ -3,7 +3,12 @@ local skynet = require "skynet"
-- register a dummy callback function
skynet.dispatch()
local function timeout(t)
print(t)
end
skynet.start(function()
skynet.timeout(500, timeout, "Hello World")
for i = 1, 10 do
print(i)
skynet.sleep(100)