Skip to content

sched.lua new_task()和run问题 #23

@sandy1219

Description

@sandy1219

local emitter_task = new_task(function() ...... end),不用调用emitter_task:run() 或者 sched.run(emitter_task ) 定时器就已经开始执行了,在new_task中 new_tasks[taskd] = true 这一步已经做了

run这个api 是不是应该是这样的
M.run = function ( task, ... )
local taskd
if type(task)=='function' then
taskd = new_task( task )
else
taskd = task
end
new_tasks[taskd] = true;
return taskd
end
把new_tasks[taskd] = true 这行代码 从new_task中移除 加入到 run中 是不是更合适?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions