Skip to content

Commit

Permalink
add testterm
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwu committed Sep 25, 2014
1 parent ce6efc5 commit b923f93
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/testterm.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
local skynet = require "skynet"

local function term()
skynet.error("Sleep one second, and term the call to UNEXIST")
skynet.sleep(100)
local self = skynet.self()
skynet.send(skynet.self(), "debug", "TERM", "UNEXIST")
end

skynet.start(function()
skynet.fork(term)
skynet.error("call an unexist named service UNEXIST, may block")
pcall(skynet.call, "UNEXIST", "lua", "test")
skynet.error("unblock the unexisted service call")
end)

0 comments on commit b923f93

Please sign in to comment.