testing...
This commit is contained in:
parent
59cbeb6597
commit
5359be0772
@ -52,6 +52,9 @@ function multi:newProxy(list)
|
|||||||
c.is_init = false
|
c.is_init = false
|
||||||
local multi, thread = nil, nil
|
local multi, thread = nil, nil
|
||||||
function c:init()
|
function c:init()
|
||||||
|
for i,v in pairs(self) do
|
||||||
|
print("Pattern",i,v)
|
||||||
|
end
|
||||||
local multi, thread = nil, nil
|
local multi, thread = nil, nil
|
||||||
local function copy(obj)
|
local function copy(obj)
|
||||||
if type(obj) ~= 'table' then return obj end
|
if type(obj) ~= 'table' then return obj end
|
||||||
@ -169,6 +172,7 @@ function multi:newProxy(list)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function c:getTransferable()
|
function c:getTransferable()
|
||||||
local cp = {}
|
local cp = {}
|
||||||
local multi, thread = require("multi"):init()
|
local multi, thread = require("multi"):init()
|
||||||
@ -193,8 +197,12 @@ function multi:newProxy(list)
|
|||||||
proxy.funcs = self.funcs
|
proxy.funcs = self.funcs
|
||||||
return proxy:init()
|
return proxy:init()
|
||||||
end
|
end
|
||||||
|
for i,v in pairs(cp) do
|
||||||
|
print("TRANS", i, v)
|
||||||
|
end
|
||||||
return cp
|
return cp
|
||||||
end
|
end
|
||||||
|
|
||||||
self:create(c)
|
self:create(c)
|
||||||
return c
|
return c
|
||||||
end
|
end
|
||||||
|
|||||||
@ -195,25 +195,25 @@ multi:newThread("Scheduler Thread",function()
|
|||||||
|
|
||||||
local tloop = stp:newTLoop(nil, 1)
|
local tloop = stp:newTLoop(nil, 1)
|
||||||
|
|
||||||
multi:newSystemThread("Testing proxy copy THREAD",function(tloop)
|
-- multi:newSystemThread("Testing proxy copy THREAD",function(tloop)
|
||||||
local multi, thread = require("multi"):init()
|
-- local multi, thread = require("multi"):init()
|
||||||
for i,v in pairs(tloop.funcs) do
|
-- for i,v in pairs(tloop.funcs) do
|
||||||
print(i,v)
|
-- print(i,v)
|
||||||
end
|
-- end
|
||||||
tloop = tloop:init()
|
-- tloop = tloop:init()
|
||||||
multi.print("tloop type:",tloop.Type)
|
-- multi.print("tloop type:",tloop.Type)
|
||||||
multi.print("Testing proxies on other threads")
|
-- multi.print("Testing proxies on other threads")
|
||||||
thread:newThread(function()
|
-- thread:newThread(function()
|
||||||
while true do
|
-- while true do
|
||||||
thread.hold(tloop.OnLoop)
|
-- thread.hold(tloop.OnLoop)
|
||||||
print(THREAD_NAME,"Loopy")
|
-- print(THREAD_NAME,"Loopy")
|
||||||
end
|
-- end
|
||||||
end)
|
-- end)
|
||||||
tloop.OnLoop(function(a)
|
-- tloop.OnLoop(function(a)
|
||||||
print(THREAD_NAME, "Got loop...")
|
-- print(THREAD_NAME, "Got loop...")
|
||||||
end)
|
-- end)
|
||||||
multi:mainloop()
|
-- multi:mainloop()
|
||||||
end, tloop:getTransferable()).OnError(multi.error)
|
-- end, tloop:getTransferable()).OnError(multi.error)
|
||||||
|
|
||||||
multi.print("tloop", tloop.Type)
|
multi.print("tloop", tloop.Type)
|
||||||
multi.print("tloop.OnLoop", tloop.OnLoop.Type)
|
multi.print("tloop.OnLoop", tloop.OnLoop.Type)
|
||||||
@ -225,8 +225,8 @@ multi:newThread("Scheduler Thread",function()
|
|||||||
thread.hold(tloop.OnLoop)
|
thread.hold(tloop.OnLoop)
|
||||||
multi.print("Held on proxy connection... twice")
|
multi.print("Held on proxy connection... twice")
|
||||||
proxy_test = true
|
proxy_test = true
|
||||||
end).OnError(print)
|
end).OnError(multi.error)
|
||||||
print(6)
|
|
||||||
|
|
||||||
thread:newThread(function()
|
thread:newThread(function()
|
||||||
while true do
|
while true do
|
||||||
@ -240,8 +240,8 @@ multi:newThread("Scheduler Thread",function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
t, val = thread.hold(function()
|
t, val = thread.hold(function()
|
||||||
return count == 10
|
return proxy_test
|
||||||
end,{sleep=5})
|
end,{sleep=15})
|
||||||
|
|
||||||
if val == multi.TIMEOUT then
|
if val == multi.TIMEOUT then
|
||||||
multi.error("SystemThreadedProcessor/Proxies: Failed")
|
multi.error("SystemThreadedProcessor/Proxies: Failed")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user