From 801c9e71d88ff263cfaea7b3b68d239465b50292 Mon Sep 17 00:00:00 2001 From: Ryan Ward Date: Sat, 14 Mar 2020 09:12:00 -0400 Subject: [PATCH] v14.2.0 release ready --- README.md | 23 +++++---------- changes.md | 11 ++++--- rockspecs/multi-14.2-0.rockspec | 3 +- test.lua | 52 ++++++++++++++++++++++++++------- 4 files changed, 58 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 251a911..7c80ef8 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,20 @@ -# multi Version: 14.2.0 Documentation Complete! +# Multi Version: 14.2.0 Documentation Complete, Bloat removed! Found an issue? Please [submit it](https://github.com/rayaman/multi/issues) and I'll look into it! -My multitasking library for lua. It is a pure lua binding, if you ignore the integrations and the love2d compat. If you find any bugs or have any issues, please let me know. +My multitasking library for lua. It is a pure lua binding, with exceptions of the integrations and the love2d compat. If you find any bugs or have any issues, please [let me know](https://github.com/rayaman/multi/issues) and I'll look into it!. INSTALLING ---------- Links to dependicies: -[net](https://github.com/rayaman/net) [lanes](https://github.com/LuaLanes/lanes) To install copy the multi folder into your environment and you are good to go
If you want to use the system threads, then you'll need to install lanes! -**or** use luarocks +**or** use luarocks `luarocks install multi` -~~Because of a codependency in net libaray, if using the networkmanager you will need to install the net library sepertly~~ The networkManager is currently being reworked. As of right now the net library is not required. -Going forward I will include a Release zip for love2d. I do not know why I haven't done this yet -**The Network Manager rework is currently being worked on and the old version is not included in this version. It will be released in 15.0.0** - -``` -luarocks install multi -luarocks install lnet (If planning on using the networkManager) -``` +Going forward I will include a Release zip for love2d. +**The Network Manager rework is currently being worked on and the old version is not included in this version.** Discord ------- @@ -30,10 +23,10 @@ https://discord.gg/U8UspuA
Planned features/TODO --------------------- -- [ ] Finish Documentation +- [x] ~~Finish Documentation~~ Finished - [ ] Network Parallelism rework -Usage:
+Usage: [Check out the documentation for more info](https://github.com/rayaman/multi/blob/master/Documentation.md)
----- ```lua local multi, thread = require("multi").init() @@ -54,4 +47,4 @@ end Known Bugs/Issues ----------------- -Check the Issue tab for issues +Check the [Issues tab](https://github.com/rayaman/multi/issues) for issues diff --git a/changes.md b/changes.md index fbbcca4..3a60bcc 100644 --- a/changes.md +++ b/changes.md @@ -2,9 +2,9 @@ Table of contents --- +[Update 14.2.0 - Bloatware Removed](#update-1420---bloatware-removed)
[Update 14.1.0 - A whole new world of possibilities](#update-1410---a-whole-new-world-of-possibilities)
[Update 14.0.0 - Consistency, Additions and Stability](#update-1400---consistency-additions-and-stability)
[Update 13.1.0 - Bug fixes and features added](#update-1310---bug-fixes-and-features-added)
[Update 13.0.0 - Added some documentation, and some new features too check it out!](#update-1300---added-some-documentation-and-some-new-features-too-check-it-out)
[Update 12.2.2 - Time for some more bug fixes!](#update-1222---time-for-some-more-bug-fixes)
[Update 12.2.1 - Time for some bug fixes!](#update-1221---time-for-some-bug-fixes)
[Update 12.2.0 - The chains of binding](#update-1220---the-chains-of-binding)
[Update 12.1.0 - Threads just can't hold on anymore](#update-1210---threads-just-cant-hold-on-anymore)
[Update: 12.0.0 - Big update (Lots of additions some changes)](#update-1200---big-update-lots-of-additions-some-changes)
[Update: 1.11.1 - Small Clarification on Love](#update-1111---small-clarification-on-love)
[Update: 1.11.0](#update-1110)
[Update: 1.10.0](#update-1100)
[Update: 1.9.2](#update-192)
[Update: 1.9.1 - Threads can now argue](#update-191---threads-can-now-argue)
[Update: 1.9.0](#update-190)
[Update: 1.8.7](#update-187)
[Update: 1.8.6](#update-186)
[Update: 1.8.5](#update-185)
[Update: 1.8.4](#update-184)
[Update: 1.8.3 - Mainloop recieves some needed overhauling](#update-183---mainloop-recieves-some-needed-overhauling)
[Update: 1.8.2](#update-182)
[Update: 1.8.1](#update-181)
[Update: 1.7.6](#update-176)
[Update: 1.7.5](#update-175)
[Update: 1.7.4](#update-174)
[Update: 1.7.3](#update-173)
[Update: 1.7.2](#update-172)
[Update: 1.7.1 - Bug Fixes Only](#update-171---bug-fixes-only)
[Update: 1.7.0 - Threading the systems](#update-170---threading-the-systems)
[Update: 1.6.0](#update-160)
[Update: 1.5.0](#update-150)
[Update: 1.4.1 (4/10/2017) - First Public release of the library](#update-141-4102017---first-public-release-of-the-library)
[Update: 1.4.0 (3/20/2017)](#update-140-3202017)
[Update: 1.3.0 (1/29/2017)](#update-130-1292017)
[Update: 1.2.0 (12.31.2016)](#update-120-12312016)
[Update: 1.1.0](#update-110)
[Update: 1.0.0](#update-100)
[Update: 0.6.3](#update-063)
[Update: 0.6.2](#update-062)
[Update: 0.6.1-6](#update-061-6)
[Update: 0.5.1-6](#update-051-6)
[Update: 0.4.1](#update-041)
[Update: 0.3.0 - The update that started it all](#update-030---the-update-that-started-it-all)
[Update: EventManager 2.0.0](#update-eventmanager-200)
[Update: EventManager 1.2.0](#update-eventmanager-120)
[Update: EventManager 1.1.0](#update-eventmanager-110)
[Update: EventManager 1.0.0 - Error checking](#update-eventmanager-100---error-checking)
[Version: EventManager 0.0.1 - In The Beginning things were very different](#version-eventmanager-001---in-the-beginning-things-were-very-different) - -# Update 14.2.0 - Removing Bloat +# Update 14.2.0 - Bloatware Removed Full Update Showcase --- ```lua @@ -22,6 +22,7 @@ end) c3 = c(function() print("called 3") end) + print(c1,c2.Type,c3) c:Fire() c2:Destroy() @@ -38,15 +39,18 @@ local test = multi:newThread(function() print("Hello!") end end) + test.OnDeath(function() - os.exit() -- This is the last thing callec. I link to end the loop when doing examples + os.exit() -- This is the last thing called. end) + local alarm = multi:newAlarm(4):OnRing(function(a) print(a.Type) a:Destroy() print(a.Type) test:Destroy() end) + multi:lightloop() ``` Going Forward: @@ -72,7 +76,6 @@ Fixed: - Issue with connections where connection chaining wasn't working properly. This has been addressed. ```lua package.path="?.lua;?/init.lua;?.lua;?/?/init.lua;"..package.path - --local sterilizer = require("multi.integration.sterilization") local multi,thread = require("multi"):init() test = multi:newConnection() test(function(hmm) diff --git a/rockspecs/multi-14.2-0.rockspec b/rockspecs/multi-14.2-0.rockspec index 0d5c810..313a79b 100644 --- a/rockspecs/multi-14.2-0.rockspec +++ b/rockspecs/multi-14.2-0.rockspec @@ -7,7 +7,8 @@ source = { description = { summary = "Lua Multi tasking library", detailed = [[ - This library contains many methods for multi tasking. Features non coroutine based multitasking, coroutine based multi tasking, and system threading (Requires use of an integration). Check github for how to use. + This library contains many methods for multi tasking. Features non coroutine based multi-tasking, coroutine based multi-tasking, and system threading (Requires use of an integration). + Check github for how to use. ]], homepage = "https://github.com/rayaman/multi", license = "MIT" diff --git a/test.lua b/test.lua index 30cf109..e8b20d5 100644 --- a/test.lua +++ b/test.lua @@ -1,14 +1,44 @@ package.path="?.lua;?/init.lua;?.lua;?/?/init.lua;"..package.path -multi, thread = require("multi"):init() -conn = multi:newConnection() -func = thread:newFunction(function() - a,b,c = thread.holdFor(.5,conn) - print(a,b) - os.exit() +local multi,thread = require("multi"):init() + +-- Testing destroying and fixed connections +c = multi:newConnection() +c1 = c(function() + print("called 1") end) -func() -multi:setTimeout(function() - print("Test!") - conn:Fire(1,2,3) -end,1) +c2 = c(function() + print("called 2") +end) +c3 = c(function() + print("called 3") +end) + +print(c1,c2.Type,c3) +c:Fire() +c2:Destroy() +print(c1,c2.Type,c3) +c:Fire() +c1:Destroy() +print(c1,c2.Type,c3) +c:Fire() + +-- Destroying alarms and threads +local test = multi:newThread(function() + while true do + thread.sleep(1) + print("Hello!") + end +end) + +test.OnDeath(function() + os.exit() -- This is the last thing called. +end) + +local alarm = multi:newAlarm(4):OnRing(function(a) + print(a.Type) + a:Destroy() + print(a.Type) + test:Destroy() +end) + multi:lightloop() \ No newline at end of file