9 Commits
Author SHA1 Message Date
server 2d239c65ea tests 2021-04-30 10:48:58 -04:00
server fd8e77555a Testing something 2021-04-30 10:00:13 -04:00
server b60aab9602 Will be coming back to this project
Plan on finally getting back to working on the network parallelism.
2021-04-29 15:34:13 -04:00
server 180176e2cf Updated License date 2021-04-03 12:40:33 -04:00
server 952b592b97 Update README.md
fixed typo
2020-12-24 12:38:07 -05:00
server b597fbdf9b removed okd files 2020-03-14 20:21:08 -04:00
server 8fbaa76fe9 removed old files 2020-03-14 20:16:45 -04:00
server abb3da416f Merge pull request #18 from rayaman/v14.2.0
v14.2.0 release ready
2020-03-14 09:13:57 -04:00
server 8ba489dc58 Merge pull request #17 from rayaman/v14.2.0
V14.2.0
2020-03-14 08:35:29 -04:00
7 changed files with 14 additions and 143 deletions
-50
View File
@@ -1,50 +0,0 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "launch-lua",
"type": "lua",
"request": "launch",
"workingDirectory": "${workspaceRoot}",
"sourceBasePath": "${workspaceRoot}",
"executable": "C:\\Program Files (x86)\\Lua\\5.1\\lua.exe",
"arguments": "main.lua",
"listenPublicly": false,
"listenPort": 56789,
"encoding": "UTF-8",
"env": {}
},
{
"name": "launch-gideros",
"type": "lua",
"request": "launch",
"workingDirectory": "${workspaceRoot}",
"giderosPath": "C:/Program Files (x86)/Gideros",
"gprojPath": "${workspaceRoot}/GPROJ.gproj",
"jumpToGiderosErrorPosition": false,
"stopGiderosWhenDebuggerStops": true,
"listenPublicly": false,
"listenPort": 56789,
"encoding": "UTF-8"
},
{
"name": "wait",
"type": "lua",
"request": "attach",
"workingDirectory": "${workspaceRoot}",
"sourceBasePath": "${workspaceRoot}",
"listenPublicly": false,
"listenPort": 56789,
"encoding": "UTF-8"
},
{
"type": "lua",
"request": "launch",
"name": "Launch",
"program": "${workspaceFolder}/test.lua"
}
]
}
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2020 Ryan Ward
Copyright (c) 2021 Ryan Ward
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+2 -1
View File
@@ -6,7 +6,7 @@ My multitasking library for lua. It is a pure lua binding, with exceptions of th
INSTALLING
----------
Links to dependicies:
Links to dependencies:
[lanes](https://github.com/LuaLanes/lanes)
To install copy the multi folder into your environment and you are good to go</br>
@@ -25,6 +25,7 @@ Planned features/TODO
---------------------
- [x] ~~Finish Documentation~~ Finished
- [ ] Network Parallelism rework
- [ ] Fix some bugs
Usage: [Check out the documentation for more info](https://github.com/rayaman/multi/blob/master/Documentation.md)</br>
-----
-25
View File
@@ -1,25 +0,0 @@
-- set up the package
package.path="?/init.lua;?.lua;"..package.path
-- Import the libraries
multi = require("multi")
local GLOBAL, THREAD = require("multi.integration.lanesManager").init()
nGLOBAL = require("multi.integration.networkManager").init()
-- Act as a master node
master = multi:newMaster{
name = "Main", -- the name of the master
--noBroadCast = true, -- if using the node manager, set this to true to avoid double connections
--managerDetails = {"localhost",12345}, -- the details to connect to the node manager (ip,port)
}
master.OnError(function(name,err)
print(name.." has encountered an error: "..err)
end)
master.OnNodeConnected(function(name)
-- name is the name of the node that connected
end)
-- Starting the multitasker
settings = {
priority = 0, -- 0, 1 or 2
protect = false,
}
multi:threadloop(settings) -- both mainloop and threadloop can be used. one pirotizes threads where the other pirotizes multiobjs
--multi:mainloop(settings)
-16
View File
@@ -1,16 +0,0 @@
package.path="?/init.lua;?.lua;"..package.path
multi = require("multi")
local GLOBAL, THREAD = require("multi.integration.lanesManager").init()
nGLOBAL = require("multi.integration.networkManager").init()
node = multi:newNode{
allowRemoteRegistering = true, -- allows you to register functions from the master on the node, default is false
name = nil, -- default value
--noBroadCast = true, -- if using the node manager, set this to true to prevent the node from broadcasting
--managerDetails = {"localhost",12345}, -- connects to the node manager if one exists
}
settings = {
priority = 0, -- 1 or 2
stopOnError = true, -- if an actor crashes this will prevent it from constantly crashing over and over. You can leave this false and use multi.OnError to handle crashes as well
protect = true, -- always protect a node. Not really needed since all executed xode from a master is protected on execution to prevent issues.
}
multi:mainloop(settings)
-12
View File
@@ -1,12 +0,0 @@
package.path="?/init.lua;?.lua;"..package.path
multi = require("multi")
local GLOBAL, THREAD = require("multi.integration.lanesManager").init()
nGLOBAL = require("multi.integration.networkManager").init()
multi:nodeManager(12345) -- Host a node manager on port: 12345
print("Node Manager Running...")
settings = {
priority = 0, -- 1 or 2
protect = false,
}
multi:mainloop(settings)
-- Thats all you need to run the node manager, everything else is done automatically
+11 -38
View File
@@ -1,44 +1,17 @@
package.path="?.lua;?/init.lua;?.lua;?/?/init.lua;"..package.path
local multi,thread = require("multi"):init()
-- Testing destroying and fixed connections
c = multi:newConnection()
c1 = c(function()
print("called 1")
end)
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()
local GLOBAL, THREAD = require("multi.integration.lanesManager"):init()
multi:newSystemThread("test",function(msg)
print("In thread:", THREAD.getID(), "Msg:", msg)
while true do
-- Hold forever :D
end
end,"Passing a message")
multi:newThread("localthread",function()
print("In local thread :D")
while true do
thread.sleep(1)
print("Hello!")
print("...")
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()
multi:mainloop()