16 Commits

Author SHA1 Message Date
Heinz-Peter Liechtenecker
f3fddf5f19
Improving libcron performance (#9)
Co-authored-by: Heinz-Peter Liechtenecker <h.liechtenecker@fh-kaernten.at>
Co-authored-by: Per Malmberg <PerMalmberg@users.noreply.github.com>
2020-09-26 13:32:54 +02:00
Heinz-Peter Liechtenecker
7ef39558a1
Feature/add executed on time check (#7)
* Initial commit on executed on time feature. A task was executed on time if the function call happened within one second since it expired.

* Adding tests, fixing some errors.

* Using recursirve mutex to allowing to call safely call was_executed_on_time in an Mt-environment

* Changing from boolean expression to get_delay, being even more flexibel

* Cleanup

* Adding dedicated TaskContext

* Changing to Interface-Class Approach

* Renaming to TaskInformation, making it pure virtual

* Removing unnecessary Proxy-Class

* Cleaning up

* Passing a const reference instead of a pointer to avoid nullptr checks in the callback

* Cleaning up add_schedule.

* Adding TaskInformation API to readme.

Co-authored-by: Heinz-Peter Liechtenecker <h.liechtenecker@fh-kaernten.at>
2020-09-10 19:03:50 +02:00
Heinz-Peter Liechtenecker
76da315c13
Adding remove-feature to Cron-Class (#6)
* Adding functions to remove a specific schedule (by the given name) or all scheduled tasks from the Cron class.

* Update libcron/include/libcron/Task.h

Co-authored-by: Per Malmberg <PerMalmberg@users.noreply.github.com>

* Update libcron/include/libcron/Task.h

Co-authored-by: Per Malmberg <PerMalmberg@users.noreply.github.com>

* Update libcron/include/libcron/Cron.h

Co-authored-by: Per Malmberg <PerMalmberg@users.noreply.github.com>

* Update libcron/include/libcron/Cron.h

Co-authored-by: Per Malmberg <PerMalmberg@users.noreply.github.com>

* Update libcron/include/libcron/Cron.h

Co-authored-by: Per Malmberg <PerMalmberg@users.noreply.github.com>

* Adding Multithreading support via template, adding documentation

* Apply suggestions from code review

Co-authored-by: Per Malmberg <PerMalmberg@users.noreply.github.com>

* Finishing suggestions from code-review (renaming elements)

Co-authored-by: Per Malmberg <PerMalmberg@users.noreply.github.com>
2020-09-02 15:57:14 +02:00
Per Malmberg
c20a146980 #1 - Moved files into new structure for more modern CMake usage. 2019-03-13 10:20:21 +01:00
Per Malmberg
efeb1e4769 Fixed problem where multiple ticks within the same second causes task to expire multiple times that second. 2018-05-16 16:48:51 +02:00
Per Malmberg
c441da4287 Added UTC handling for Windows 2018-03-22 22:38:55 +01:00
Per Malmberg
5395c75061 More tests 2018-03-13 02:41:24 -07:00
Per Malmberg
35a35d99e9 Handles jumps backwards backwards >3h 2018-03-13 02:37:31 -07:00
Per Malmberg
97a0a5a9c2 Handles jumps of >=3h 2018-03-13 01:23:50 -07:00
Per Malmberg
e99b049d2b Work on DST handling. 2018-03-13 00:46:03 +01:00
Per Malmberg
47a615897a Initial thought about handling clock changes: Follow RedHat's implementation at https://access.redhat.com/solutions/477963
If time moves >=3h, then consider it a adjustment and reschedule based on the new time.
If time changes backwards <3h, prevent running tasks twice.
If forward <3h run tasks that would have run in the skipped time.
2018-03-12 00:08:20 +01:00
Per Malmberg
9f7c5dc2fa Added LocalClock. 2018-03-11 23:38:12 +01:00
Per Malmberg
74e1ad4d60 Added the concept of a clock to Cron. 2018-03-11 20:09:06 +01:00
Per Malmberg
d7c17be4d1 Updated README.
Added tests.
Made use of ? mandatory for DoM/DoW.
2018-03-11 18:45:27 +01:00
Per Malmberg
d2ec26f494 Moce functionality in main Cron class with added tests. 2018-03-11 15:26:26 +01:00
Per Malmberg
0db05ac71b Functionality in main Cron class. 2018-03-10 23:42:00 +01:00