Skip to content

Commit

Permalink
docs: updated scheduler cond examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Miksus committed Sep 18, 2022
1 parent 6528962 commit 18617fe
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/code/conds/api/scheduler_cycles.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from rocketry import Rocketry
from rocketry.conds import scheduler_cycles

app = Rocketry(config={
"shut_cond": scheduler_cycles(more_than=1)
})
File renamed without changes.
13 changes: 12 additions & 1 deletion docs/handbooks/conditions/api/scheduler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,16 @@ if the scheduler has been running more than
given in ``more_than`` argument. There is also
an argument ``less_than`` to specify the maximum.

.. literalinclude:: /code/conds/api/scheduler.py
.. literalinclude:: /code/conds/api/scheduler_running.py
:language: py

There is also a condition ``scheduler_cycles`` that
also takes ``more_than`` and ``less_than`` arguments
which are both integers. This condition checks whether
the scheduler has looped through the tasks for given
number of time. This is useful for testing to, for example,
do a short test that the scheduler launches your task.
It is extensively used in Rocketry's unit tests.

.. literalinclude:: /code/conds/api/scheduler_cycles.py
:language: py

0 comments on commit 18617fe

Please sign in to comment.