diff --git a/developer_manual/digging_deeper/task_processing.rst b/developer_manual/digging_deeper/task_processing.rst index f182a502d..b6bb33b02 100644 --- a/developer_manual/digging_deeper/task_processing.rst +++ b/developer_manual/digging_deeper/task_processing.rst @@ -15,6 +15,7 @@ To consume the Task Processing API, you will need to :ref:`injectgetAvailableTaskTypes()[TextToTextSummary::ID]) { + // getAvailableTaskTypeIds is faster than getAvailableTaskTypes + // if (isset($textprocessingManager->getAvailableTaskTypes()[TextToTextSummary::ID]) { + // if you don't need the task type metadata, prefer this: + if (in_array(TextToTextSummary::ID, $textprocessingManager->getAvailableTaskTypeIds(), true) { $summaryTask = new Task(TextToTextSummary::ID, $emailText, "my_app", $userId, (string) $emailId); } else { // cannot use summarization