Finalized the SCHEDULER and SCHEDULERDISPATCHER

- Done, time to remerge the work.
This commit is contained in:
FlightControl
2016-12-14 11:10:00 +01:00
parent 84e2361829
commit 365034ad69
11 changed files with 78 additions and 34 deletions

View File

@@ -0,0 +1,41 @@
--- Simple repeat scheduling of a function.
--
-- ===
--
-- Author: FlightControl
-- Date Created: 14 Dec 2016
--
-- # Situation
-- Uses the Tracing functions from BASE within the DCS.log file. Check the DCS.log file for the results.
-- Create a new SCHEDULER object.
-- Check the DCS.log.
--
-- Start a schedule called TestScheduler. TestScheduler will repeat the words "Hello World Repeat" every second in the log.
-- After 10 seconds, TestScheduler will stop the scheduler.
-- After 20 seconds, TestScheduler will restart the scheduler.
--
-- # Test cases:
--
-- 1. Check that the "Hello World Repeat" lines are consistent with the scheduling timing. They should stop showing after 10 seconds, and restart after 20 seconds.
--
--
-- # Status: TESTED - 14 Dec 2016
local TestScheduler = SCHEDULER:New( nil,
function()
BASE:E( timer.getTime() .. " - Hello World Repeat")
end, {}, 1, 1
)
SCHEDULER:New( nil,
function()
TestScheduler:Stop()
end, {}, 10
)
SCHEDULER:New( nil,
function()
TestScheduler:Start()
end, {}, 20
)