-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.. _cron_basic_schedule: | ||
|
||
CRON basic schedule | ||
=================== | ||
|
||
The idea behind cron is to schedule tasks at specific interval or period of time. | ||
|
||
Library does not provide generic scheduler that would do that automatically for you, | ||
instead user should manually implement custom scheduler to periodically check and schedule should cron execute or not. | ||
|
||
.. tip:: | ||
A check should be performed at least at minimum cron granularity, that being ``1 second`` in the current revision. | ||
|
||
Basic example is very simple and does the following: | ||
|
||
* Parses cron defined by user with :cpp:`lwdtc_cron_parse` function | ||
* Reads system time periodically (example was tested under *Windows* environment) | ||
* It checks if cron is valid for execution each time new time changes versus previous check | ||
* It executes task | ||
|
||
.. literalinclude:: ../../examples/cron_basic.c | ||
:language: c | ||
:linenos: | ||
:caption: Basic CRON example with parser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ User manual | |
:maxdepth: 2 | ||
|
||
cron | ||
cron-basic-schedule | ||
cron-dt-range |