-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #178 from cloudwu/dev
release 0.7.3
- Loading branch information
Showing
11 changed files
with
115 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
local skynet = require "skynet" | ||
|
||
local mode = ... | ||
|
||
if mode == "slave" then | ||
|
||
local CMD = {} | ||
|
||
function CMD.sum(n) | ||
skynet.error("for loop begin") | ||
local s = 0 | ||
for i = 1, n do | ||
s = s + i | ||
end | ||
skynet.error("for loop end") | ||
end | ||
|
||
function CMD.blackhole() | ||
end | ||
|
||
skynet.start(function() | ||
skynet.dispatch("lua", function(_,_, cmd, ...) | ||
local f = CMD[cmd] | ||
f(...) | ||
end) | ||
end) | ||
|
||
else | ||
|
||
skynet.start(function() | ||
local slave = skynet.newservice(SERVICE_NAME, "slave") | ||
for step = 1, 20 do | ||
skynet.error("overload test ".. step) | ||
for i = 1, 512 * step do | ||
skynet.send(slave, "lua", "blackhole") | ||
end | ||
skynet.sleep(step) | ||
end | ||
local n = 1000000000 | ||
skynet.error(string.format("endless test n=%d", n)) | ||
skynet.send(slave, "lua", "sum", n) | ||
end) | ||
|
||
end |