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: docs/source/asking_questions.rst
+10-13Lines changed: 10 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,10 @@ You can also set the following options when you call :mod:`Child.ask <octue.reso
68
68
- ``question_uuid`` - if provided, the question will use this UUID instead of a generated one
69
69
- ``push_endpoint`` - if provided, the result and other events produced during the processing of the question will be pushed to this HTTP endpoint (a URL)
70
70
- ``asynchronous`` - if ``True``, don't wait for an answer to the question (the result and other events can be :ref:`retrieved from the event store later <retrieving_asynchronous_answers>`)
71
+
- If ``raise_errors=False`` is provided, answers are returned for all successful questions while unraised errors are logged and returned for unsuccessful ones
72
+
- If ``raise_errors=False`` is provided with ``max_retries > 0``, failed questions are retried up to this number of times
73
+
- If ``raise_errors=False`` is provided with ``max_retries > 0`` and ``prevent_retries_when`` is set to a list of exception types, failed questions are retried except for those whose exception types are in the list
74
+
- ``log_errors``: If `True` and ``raise_errors=False``, any errors remaining once retries are exhausted are logged in addition to being returned
71
75
- ``timeout`` - how long in seconds to wait for an answer (``None`` by default - i.e. don't time out)
72
76
73
77
Exceptions raised by a child
@@ -185,8 +189,8 @@ access the event store and run:
185
189
186
190
Asking multiple questions in parallel
187
191
=====================================
188
-
You can also ask multiple questions to a service in parallel. By default, if any of the questions fail, an error is
189
-
raised and no answers are returned.
192
+
You can also ask multiple questions to a service in parallel - just provide any number of questions as dictionaries of
193
+
`Child.ask` arguments:
190
194
191
195
.. code-block:: python
192
196
@@ -203,18 +207,11 @@ raised and no answers are returned.
203
207
204
208
This method uses multithreading, allowing all the questions to be asked at once instead of one after another.
205
209
206
-
**Options**
210
+
.. hint::
207
211
208
-
- If ``raise_errors=False`` is provided, answers are returned for all successful questions while unraised errors are
209
-
logged and returned for unsuccessful ones
210
-
- If ``raise_errors=False`` is provided with ``max_retries > 0``, failed questions are retried up to this number of
211
-
times
212
-
- If ``raise_errors=False`` is provided with ``max_retries > 0`` and ``prevent_retries_when`` is set to a list of
213
-
exception types, failed questions are retried except for those whose exception types are in the list
214
-
- ``max_workers``: The maximum number of threads that can be used to ask questions in parallel can be set via this
215
-
argument. It has no effect on the total number of questions that can be asked via ``Child.ask_multiple``.
216
-
- ``log_errors``: If `True` and ``raise_errors=False``, any errors remaining once retries are exhausted are logged in
217
-
addition to being returned
212
+
The maximum number of threads that can be used to ask questions in parallel can be set via the ``max_workers``
213
+
argument. It has no effect on the total number of questions that can be asked, just how many can be in progress at
0 commit comments