email.lua 641 Bytes
local MsgPack = MsgPack
local skynet = require "skynet"


local TIME_WAIT = 10 

local _M = class("hero", require("unitTest.unitTest"))

function _M:start()
	self:task()
end


local taskMap = {
	list = {100},
	drawAllAttach = {100},
	delete = {100},
}

function _M:task()
	local curTask = math.randWeight(taskMap, 1)
	self[curTask](self)
	skynet.timeout(TIME_WAIT * 100, handler(self, self.task))
end

function _M:list()
	requestServer(actionCodes.Email_listRpc, '')
end

function _M:drawAllAttach()
	requestServer(actionCodes.Email_drawAllAttachRpc, '')
end

function _M:delete()
	requestServer(actionCodes.Email_delRpc, '')
end


return _M