Removed system threaded connections, soon to be replaced by proxies

This commit is contained in:
2023-07-04 16:00:37 -04:00
parent 81fc7b95c9
commit acc94ea17e
5 changed files with 121 additions and 64 deletions
+2 -1
View File
@@ -380,4 +380,5 @@ function multi:newSystemThreadedConnection(name)
self:create(c)
return c
end
end
require("multi.integration.sharedExtensions")
+2 -1
View File
@@ -152,4 +152,5 @@ function multi:newSystemThreadedConnection(name)
conn.init = function(self) return self end
GLOBAL[name or "_"] = conn
return conn
end
end
require("multi.integration.sharedExtensions")
+18 -20
View File
@@ -22,26 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
]]
local function copy(obj)
if type(obj) ~= 'table' then return obj end
local res = {}
for k, v in pairs(obj) do res[copy(k)] = copy(v) end
return res
end
function tprint (tbl, indent)
if not indent then indent = 0 end
for k, v in pairs(tbl) do
formatting = string.rep(" ", indent) .. k .. ": "
if type(v) == "table" then
print(formatting)
tprint(v, indent+1)
else
print(formatting .. tostring(v))
end
end
end
local multi, thread = require("multi"):init()
-- Returns a handler that allows a user to interact with an object on another thread!
@@ -73,6 +53,12 @@ function multi:newProxy(list)
local multi, thread = nil, nil
function c:init()
local multi, thread = nil, nil
local function copy(obj)
if type(obj) ~= 'table' then return obj end
local res = {}
for k, v in pairs(obj) do res[copy(k)] = copy(v) end
return res
end
if not(c.is_init) then
c.is_init = true
local multi, thread = require("multi"):init()
@@ -132,6 +118,12 @@ function multi:newProxy(list)
end).OnError(multi.error)
return self
else
local function copy(obj)
if type(obj) ~= 'table' then return obj end
local res = {}
for k, v in pairs(obj) do res[copy(k)] = copy(v) end
return res
end
local multi, thread = require("multi"):init()
local me = self
local funcs = copy(self.funcs)
@@ -180,6 +172,12 @@ function multi:newProxy(list)
function c:getTransferable()
local cp = {}
local multi, thread = require("multi"):init()
local function copy(obj)
if type(obj) ~= 'table' then return obj end
local res = {}
for k, v in pairs(obj) do res[copy(k)] = copy(v) end
return res
end
cp.is_init = true
cp.proxy_link = self.proxy_link
cp.name = self.name