Added the files

Initial file addition
This commit is contained in:
2017-06-01 20:49:33 -04:00
commit a64482e695
24 changed files with 2259 additions and 0 deletions
+94
View File
@@ -0,0 +1,94 @@
History: EventManager,EventManager+,MultiManager <-- Current After 6.3.0 Versioning scheme was altered. A.0.0
Changelog starts at Version A.0.0
New in A.0.0
Nothing really however a changelog will now be recorded!
version.major.minor
New in A.1.0
Changed: multi:newConnection(protect) method
Changed the way you are able to interact with it by adding the __call metamethod
Old usage:
OnUpdate=multi:newConnection()
OnUpdate:connect(function(...)
print("Updating",...)
end)
OnUpdate:Fire(1,2,3)
New usage: notice that connect is no longer needed! Both ways still work! and always will work :)
OnUpdate=multi:newConnection()
OnUpdate(function(...)
print("Updating",...)
end)
OnUpdate:Fire(1,2,3)
New in A.2.0 (12/31/2016)
Added:
connectionobj.getConnection(name)
returns a list of an instance (or instances) of a single connect made with connectionobj:connect(func,name) or connectionobj(func,name)
if you can orginize data before hand you can route info to certain connections thus saving a lot of cpu time. NOTE: only one name per each connection... you can't have 2 of the same names in a dictonary... the last one will be used
Changed: obj=multi:newConnection()
obj:connect(func,name) and obj(func,name)
Added the name argument to allow indexing specific connection objects... Useful when creating an async library
New in A.3.0 (1/29/2017)
Added:
Load detection!
multi.threshold -- minimum amount of cycles that all mObjs should be allotted before the Manager is considered burdened. Defualt: 256
multi.threstimed -- amount of time when counting the number of cycles, Greater gives a more accurate view of the load, but takes more time. Defualt: .001
multi:setThreshold(n) -- method used to set multi.threshold
multi:setThrestimed(n) -- method used to set multi.threstimed
multi:getLoad() -- returns a number between 0 and 100
New in A.4.0 (3/20/2017)
Added:
multiobj:reallocate(ProcessObj) -- changes the parent process of an object
ProcessObj:getController() -- returns the mThread so you can opperate on it like a multiobj
Example1:
require("multimanager") -- require the library
int1=multi:newProcess() -- create a process
int1.NAME="int1" -- give it a name for example purposes
int2=multi:newProcess() -- create another process to reallocate
int2.NAME="int2" -- name this a different name
step=int1:newTStep(1,10) -- create a TStep so we can slowly see what is going on
step:OnStep(function(p,s) -- connect to the onstep event
print(p,s.Parent.NAME) -- print the position and process name
end)
step:OnEnd(function(s) -- when the step ends lets reallocate it to the other process
if s.Parent.NAME=="int1" then -- lets only do this if it is in the int1 process
s:reallocate(int2) -- send it to int2
s:Reset() -- reset the object
else
print("We are done!")
os.exit() -- end the program when int2 did its thing
end
end)
int1:Start() -- start process 1
int2:Start() -- start process 2
multi:mainloop() -- start the main loop
Fixed/Updated:
queuer=multi:newQueuer([string: file])
Alarms now preform as they should on a queuer
Example2:
int=multi:newQueuer()
step=int:newTStep(1,10,1,.5)
alarm=int:newAlarm(2)
step2=int:newTStep(1,5,1,.5)
step:OnStep(function(p,s)
print(p)
end)
step2:OnStep(function(p,s)
print(p,"!")
end)
alarm:OnRing(function(a)
print("Ring1!!!")
end)
int:OnQueueCompleted(function(s)
s:Pause()
print("Done!")
os.exit()
end)
int:Start()
multi:mainloop()
New in A.4.1 (4/10/2017)
Change:
small change to the hold method to make it a bit more lightweight
Using a timer instead of an alarm object!
Limits to hold:
cannot hold more than 1 object at a time, and doing so could cause a deadlock!
Upcomming:
Threaded objects wrapped in corutines, so you can hold/sleep without problems!
+55
View File
@@ -0,0 +1,55 @@
'Current Version: A.4.1 stable
MultiManager has 19 Objects: # indicates most commonly used 1-19 1 being the most used by me
+Events #7
+Alarms #2
+Loops #3
+Steps #4
+TSteps #6
+Triggers #16
+Tasks #12
+Connections #1 -- This is a rather new feature of this library, but has become the most useful for async handling. Knowing this is already 50% of this library
+Timers #14 -- this was tricky because these make up both Alarms and TSteps, but in purly using this standalone is almost non existent
+Jobs #11
+Process #10
+Conditions #15
+Ranges #8
+Threads #13
+Functions #5
+Queuers #17
+Updaters #9
+Watchers #18
+CustomObjects #19
Constructors [Runners]
---------------------- Note: multi is the main Processor Obj It cannot be paused or destroyed (kinda)
ProcessObj=multi:newProcess([string: FILE defualt: nil])
ProcessObj=multi:newQueuer([string: FILE defualt: nil])
NOTE: The multi namespace is also a ProcessObj
Constructors [ACTORS]
--------------------- Note: everything is a multiObj!
eventObj=multi:newEvent([function: TASK defualt: function() end])
alarmObj=multi:newAlarm([number: SET defualt: 0])
loopObj=multi:newLoop([function: FUNC])
stepObj=multi:newStep([number: START defualt: 0],[number: RESET defualt: inf],[number: COUNT defualt: 1],[number: SKIP defualt: 0])
tstepObj=multi:newTStep([number: START defualt: 0],[number: RESET defualt: inf],[number: COUNT defualt: 1],[number: SET defualt: 1])
updaterObj=multi:newUpdater([number: SKIP defualt: 0])
watcherObj=multi:newWatcher(table: NAMESPACE,string: NAME)
multiObj=multi:newCustomObject([table: OBJREF],[string: T='process'])
Constructors [Semi-ACTORS]
--------------------------
multi:newJob(function: func,[string: name])
multi:newRange(number: a,number: b,[number: c])
multi:newCondition(func)
void=multi:newThread(string: name,function: func)
Constructors [NON-ACTORS]
-------------------------
multi:newTrigger(function: func)
multi:newTask(function: func)
multi:newConnection()
multi:newTimer()
multi:newFunction(function: func)