Fixed and documented the newProcessor changes. Rockspec fix

This commit is contained in:
Ryan Ward 2022-04-02 00:22:34 -04:00
parent e8a3cd731d
commit c0fb94ddbb
3 changed files with 11 additions and 7 deletions

View File

@ -13,6 +13,9 @@ Full Update Showcase
Added:
---
- `multi:newProcessor(name, nothread)`
- If no thread is true auto sets the processor as Active, so proc.run() will start without the need for proc.Start()
- `multi:getProcessors()`
- Returns a list of all processors

View File

@ -21,8 +21,8 @@ build = {
type = "builtin",
modules = {
["multi"] = "multi/init.lua",
["multi.compat.love2d"] = "multi/compat/love2d.lua",
["multi.compat.lovr"] = "multi/compat/lovr.lua",
--["multi.compat.love2d"] = "multi/compat/love2d.lua",
--["multi.compat.lovr"] = "multi/compat/lovr.lua",
["multi.integration.lanesManager"] = "multi/integration/lanesManager/init.lua",
["multi.integration.lanesManager.extensions"] = "multi/integration/lanesManager/extensions.lua",
["multi.integration.lanesManager.threads"] = "multi/integration/lanesManager/threads.lua",

View File

@ -2,7 +2,7 @@ if os.getenv("LOCAL_LUA_DEBUGGER_VSCODE") == "1" then
package.path="multi/?.lua;multi/?/init.lua;multi/?.lua;multi/?/?/init.lua;"..package.path
require("lldebugger").start()
else
package.path="./?.lua;../?/init.lua;../?.lua;../?/?/init.lua;"..package.path
--package.path="./?.lua;../?/init.lua;../?.lua;../?/?/init.lua;"..package.path
end
--[[
This file runs all tests.
@ -20,9 +20,9 @@ end
The expected and actual should "match" (Might be impossible when playing with threads)
This will be pushed directly to the master as tests start existing.
]]
local multi, thread = require("multi"):init{priority=true}
local multi, thread = require("multi"):init()--{priority=true}
local good = false
local proc = multi:newProcessor("Test")
local proc = multi:newProcessor("Test",true)
proc:newAlarm(3):OnRing(function()
good = true
end)
@ -148,6 +148,7 @@ end)
runTest().OnError(function(...)
print("Error:",...)
end)
print("Pumping proc")
while true do
proc.run()
end