From b251758790262647eee677d568af1d869b6b36a1 Mon Sep 17 00:00:00 2001 From: Ryan Ward Date: Mon, 24 Feb 2020 15:43:31 -0500 Subject: [PATCH] Working on something interesting --- changes.md | 19 ++++++++++++++- multi/init.lua | 6 +++++ rockspecs/multi-14.2-0.rockspec | 1 - test.lua | 42 +++++++++++++++++++++++++++++---- 4 files changed, 62 insertions(+), 6 deletions(-) diff --git a/changes.md b/changes.md index f7229d3..a2948fb 100644 --- a/changes.md +++ b/changes.md @@ -4,7 +4,7 @@ Table of contents --- [Update 14.2.0 - The great pruning](#update-1420---the-great-pruning)
[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 - The great pruning +# Update 14.2.0 - [Insert Update Silly Text Here] Full Update Showcase --- ```lua @@ -81,6 +81,23 @@ Added: Fixed: --- - Issue with connections not returning a handler for managing a specified conn object. +- 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) + print("hi",hmm.t) + hmm.t = 2 + end)(function(hmm) + print("hi2",hmm.t) + hmm.t = 3 + end)(function(hmm) + print("hi3",hmm.t) + end) + test:Fire({t=1}) + ``` Changed: --- diff --git a/multi/init.lua b/multi/init.lua index d8b40da..a23ddd2 100644 --- a/multi/init.lua +++ b/multi/init.lua @@ -447,7 +447,13 @@ function multi:newConnection(protect,func,kill) Type="connector_link", ID=self.ID, Parent=self, + connect = function(s,...) + return self:connect(...) + end } + setmetatable(temp,{__call=function(s,...) + return self:connect(...) + end}) function temp:Fire(...) if self.Parent.lock then return end if self.Parent.protect then diff --git a/rockspecs/multi-14.2-0.rockspec b/rockspecs/multi-14.2-0.rockspec index fb261b9..a003691 100644 --- a/rockspecs/multi-14.2-0.rockspec +++ b/rockspecs/multi-14.2-0.rockspec @@ -30,6 +30,5 @@ build = { ["multi.integration.loveManager.threads"] = "multi/integration/loveManager/threads.lua", ["multi.integration.luvitManager"] = "multi/integration/luvitManager.lua", --["multi.integration.networkManager"] = "multi/integration/networkManager.lua", - --["multi.integration.shared"] = "multi/integration/shared.lua" } } \ No newline at end of file diff --git a/test.lua b/test.lua index d5c06bb..b54e888 100644 --- a/test.lua +++ b/test.lua @@ -1,5 +1,39 @@ package.path="?.lua;?/init.lua;?.lua;?/?/init.lua;"..package.path ---local sterilizer = require("multi.integration.sterilization") -local multi,thread = require("multi"):init() - -multi:lightloop() \ No newline at end of file +-- local sterilizer = require("multi.integration.sterilization") +multi,thread = require("multi"):init() +test = {} +test.temp = {} +test.temp.hello = multi:newAlarm(3) +function inList(t,o) + for i,v in pairs(t) do + if v==o then + return v + end + end +end +function getPath(tbl, obj, conn, indent, loop, path) + if not indent then indent = 0 end + if not loop then loop = {} end + if not path then path = {"_G"} end + for k, v in pairs(tbl) do + formatting = string.rep(" ", indent) .. k .. ": " + --print(k,v==obj) + if type(v) == "table" then + if not inList(loop,v) and type(k)~="number" then + --print(formatting) + table.insert(loop,v) + table.insert(path,k) + getPath(v, obj, conn, indent + 1, loop, path) + table.remove(path) + end + end + if v==obj then + local str = table.concat(path,".").."."..k + str = str:reverse() + conn(str:sub(1,(str:find("G_"))+1):reverse()) + end + end +end +getPath(_G, test.temp.hello.Act,function(path) + print(path) +end) \ No newline at end of file