mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 02:53:09 +00:00
add testterm
This commit is contained in:
15
test/testterm.lua
Normal file
15
test/testterm.lua
Normal file
@@ -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)
|
||||
Reference in New Issue
Block a user