Skip to content

Added system-task doc #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,8 @@ pseudoxml:
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
@echo
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."

ditaa:
ditaa img/state-machine.ditaa -o -S -E
@echo
@echo "Build finished. The image files files are in img"
12 changes: 8 additions & 4 deletions img/state-machine.ditaa
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@
|
| +-------------+
+--> | failed |
+-------------+
| - exception |
| - endTime |
| - duration |
| +-------------+
| | - exception |
| | - endTime |
| | - duration |
| +-------------+
|
| +-------------+
+--> | aborted |
+-------------+
Binary file modified img/state-machine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 40 additions & 4 deletions symfony.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Additional features which are implemented in this bundle.
* Different commands to manage and debug commands
* Persist tasks and executions in database
* Run statistics foreach execution of tasks
* Predefined system-tasks

Installation
------------
Expand Down Expand Up @@ -51,15 +52,50 @@ tasks.
This option only works if you enable the storage in doctrine which will
persist your tasks in a table-structure.

System-Tasks
------------

System-tasks can be used to predefine tasks for deployment. The developer
can define which handler will be called (with an ``cron_expression`` and
a ``workload``). This tasks can be scheduled with the following command.

.. code-block:: yaml

task:
system_tasks:
my-task:
enabled: true
handler_class: 'AppBundle\Handler\TestHandler'
cron_expression: '@daily'

.. code-block:: bash

bin/console task:schedule:system-tasks

Already scheduled system-tasks can be disabled in the configuration. But
bigger changes like changing the ``handler_class`` are currently not
supported.

After addition or changing in the config you have to run the command again
to be sure that the task-table will be updated.

Configuration Reference
-----------------------

.. code-block:: yaml

task:
storage: array # One of "array" or "doctrine"
run:
mode: 'off' # One of "off" or "listener"
task:
storage: doctrine # One of "array"; "doctrine"
adapters:
doctrine:
clear: true
run:
mode: 'off' # One of "off"; "listener"
system_tasks:
enabled: true
handler_class: ~
workload: null
cron_expression: ~

.. _fastcgi_finish_request: http://php.net/manual/en/function.fastcgi-finish-request.php
.. _PHP FPM: http://php.net/manual/en/install.fpm.php