added newTimeout

This commit is contained in:
Ryan Ward 2024-11-05 12:44:26 -05:00
parent d4562f0228
commit 7ba48f8c57
3 changed files with 11 additions and 10 deletions

View File

@ -1,19 +1,13 @@
# Multi Version: 16.0.0 - Connecting the dots
# Multi Version: 16.1.0 -
**Key Changes**
- Expanded connection logic
- New integration priorityManager
- Tests for threads
- Consistent behavior between the threading integrations
- Improved love2d threading
- Bug fixes
-
Found an issue? Please [submit it](https://github.com/rayaman/multi/issues) and someone will look into it!
My multitasking library for lua. It is a pure lua binding, with exceptions of the integrations.
</br>
Progress is being made in [v16.0.0](https://github.com/rayaman/multi/tree/v16.0.0)
Progress is being made in [v16.1.0](https://github.com/rayaman/multi/tree/v16.1.0)
---
</br>

View File

@ -95,7 +95,7 @@ multi.Children = {}
multi.Active = true
multi.Type = multi.registerType("rootprocess")
multi.LinkedPath = multi
multi.TIMEOUT = "TIMEOUT"
multi.TIMEOUT = multi.registerType("TIMEOUT", "timeouts")
multi.TID = 0
multi.defaultSettings = {}
@ -702,6 +702,12 @@ function multi:newBase(ins)
return c
end
function multi:newTimeout(timeout)
local c={}
c.Type = multi.registerType(multi.TIMEOUT, "timeouts")
return function(self) self:Destroy() return c end % self:newAlarm(timeout).OnRing
end
function multi:newTimer()
local c={}
c.Type=multi.registerType("timer", "timers")

View File

@ -0,0 +1 @@
-- Allows the creation of states