mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 03:53:09 +00:00
remove skynet.watch, move simplemonitor to examples
This commit is contained in:
27
test/testdeadcall.lua
Normal file
27
test/testdeadcall.lua
Normal file
@@ -0,0 +1,27 @@
|
||||
local skynet = require "skynet"
|
||||
|
||||
local mode = ...
|
||||
|
||||
if mode == "test" then
|
||||
|
||||
skynet.start(function()
|
||||
skynet.dispatch("lua", function (...)
|
||||
print("====>", ...)
|
||||
skynet.exit()
|
||||
end)
|
||||
end)
|
||||
|
||||
else
|
||||
|
||||
skynet.start(function()
|
||||
local test = skynet.newservice("testdeadcall", "test") -- launch self in test mode
|
||||
|
||||
print(pcall(function()
|
||||
skynet.send(test,"lua", "hello world")
|
||||
skynet.send(test,"lua", "never get there")
|
||||
skynet.call(test,"lua", "fake call")
|
||||
end))
|
||||
|
||||
skynet.exit()
|
||||
end)
|
||||
end
|
||||
Reference in New Issue
Block a user