94 lines
3.8 KiB
Plaintext
94 lines
3.8 KiB
Plaintext
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! |