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: src/util/async/README.md
+11-2Lines changed: 11 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,11 +91,14 @@ Scheduled operations can be aborted by calling
91
91
92
92
### Error handling
93
93
94
-
By default, exceptions that happen during the execution of user-provided code are caught and returned in the error channel of `std::expected` as an instance of the `ExecutionError` struct. The user can then extract the error message by calling `what()` or directly accessing the `message` member.
94
+
For APIs that return an Operation, by default, exceptions that happen during the execution of user-provided code are caught and returned in the error channel of `std::expected` as an instance of the `ExecutionError` struct. The user can then extract the error message by calling `what()` or directly accessing the `message` member.
95
+
In the `submit` API however, exceptions are caught and `ASSERT`ed on.
95
96
96
97
### Returned value
97
98
98
-
If the user-provided lambda returns anything but `void`, the type and value will propagate through the operation object and can be received by calling `get` which will block until a value or an error is available.
99
+
For `submit` API the return type is always `void`.
100
+
101
+
For other APIs, if the user-provided lambda returns anything but `void`, the type and value will propagate through the operation object and can be received by calling `get` which will block until a value or an error is available.
99
102
100
103
The `wait` member function can be used when the user just wants to wait for the value to become available but not necessarily getting at the value just yet.
101
104
@@ -122,6 +125,12 @@ This section provides some examples. For more examples take a look at `Execution
0 commit comments