You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: developer_manual/digging_deeper/task_processing.rst
+23-1Lines changed: 23 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ Consuming the Task Processing API
14
14
To consume the Task Processing API, you will need to :ref:`inject<dependency-injection>` ``\OCP\TaskProcessing\IManager``. This manager offers the following methods:
15
15
16
16
* ``hasProviders()`` This method returns a boolean which indicates if any providers have been registered. If this is false you cannot use the TextProcessing feature.
17
-
* ``getAvailableTaskTypes(bool $showDisabled = false)`` This method returns an array of enabled task types indexed by their ID with their names and additional metadata. If you set ``$showdisabled`` to ``true`` (available since NC31), it will include disabled task types.
17
+
* ``getAvailableTaskTypes(bool $showDisabled = false)`` This method returns an array of enabled task types indexed by their ID with their names and additional metadata. If you set ``$showdisabled`` to ``true`` (available since NC31), it will include disabled task types. Since NC33 this will also include the ``isInternal`` field that signifies whether the task type is user-facing or intended for internal use only.
18
18
* ``getAvailableTaskTypeIds()`` This method (available since NC32) returns a list of available task type IDs. It uses the same logic as ``getAvailableTaskTypes()`` but is faster because it does not compute the task types metadata (which can be slow when getting default field values or multiselect value lists). If you just want to check if a feature is available, prefer using this method rather than ``getAvailableTaskTypes()``.
19
19
* ``scheduleTask(Task $task)`` This method provides the actual scheduling functionality. The task is defined using the Task class. This method runs the task asynchronously in a background job.
20
20
* ``getTask(int $id)`` This method fetches a task specified by its id.
@@ -530,6 +530,28 @@ If you would like to implement providers that handle additional task types, you
530
530
}
531
531
}
532
532
533
+
Internal task types
534
+
###################
535
+
536
+
.. versionadded:: 33.0.0
537
+
538
+
Other apps and clients will assume that task types are user-facing and will display them on the frontend. If your custom
539
+
task types are not intended to be shown to users, you should implement the ``IInternalTaskType`` interface instead. This will
540
+
make sure that other apps and clients know not to show your custom task type to end users.
541
+
542
+
543
+
Triggerable providers
544
+
^^^^^^^^^^^^^^^^^^^^^
545
+
546
+
.. versionadded:: 33.0.0
547
+
548
+
Synchronous providers are executed automatically by a background job that will usually be targeted by a worker to make sure
549
+
that it runs almost instantly. ExApps on the other hand used to have to poll the server for new tasks. Since the introduction of triggerable
550
+
providers ExApps are now notified immediately of new tasks when they are scheduled. This is implemented via the ``ITriggerableProvider`` interface,
551
+
which adds an additional ``trigger(): void`` method to the provider interface which is called when a new task is scheduled for this provider and
552
+
there are no running tasks for it at the moment. Usually if you implement a provider in PHP you will not have to deal with this interface but it is documented
0 commit comments