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
+13-13
Original file line number
Diff line number
Diff line change
@@ -70,6 +70,13 @@ You can also set the following options when you call :mod:`Child.ask <octue.reso
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
71
- ``timeout`` - how long in seconds to wait for an answer (``None`` by default - i.e. don't time out)
72
72
73
+
If the question fails:
74
+
- If ``raise_errors=False``, the unraised error is returned
75
+
- If ``raise_errors=False`` and ``max_retries > 0``, the question is retried up to this number of times
76
+
- If ``raise_errors=False``, ``max_retries > 0``, and ``prevent_retries_when`` is a list of exception types, the question is retried unless the error type is in the list
77
+
- If ``raise_errors=False``, ``log_errors=True``, and the question fails after its final retry, the error is logged
78
+
79
+
73
80
Exceptions raised by a child
74
81
----------------------------
75
82
If a child raises an exception while processing your question, the exception will always be forwarded and re-raised in
@@ -185,8 +192,8 @@ access the event store and run:
185
192
186
193
Asking multiple questions in parallel
187
194
=====================================
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.
195
+
You can also ask multiple questions to a service in parallel - just provide questions as dictionaries of `Child.ask`
196
+
arguments:
190
197
191
198
.. code-block:: python
192
199
@@ -203,18 +210,11 @@ raised and no answers are returned.
203
210
204
211
This method uses multithreading, allowing all the questions to be asked at once instead of one after another.
205
212
206
-
**Options**
213
+
.. hint::
207
214
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
215
+
The maximum number of threads that can be used to ask questions in parallel can be set via the ``max_workers``
216
+
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