| | |
| | | |
| | | NS_ASSUME_NONNULL_BEGIN |
| | | |
| | | @class BFTask<ResultType>; |
| | | @class BFTask<__covariant ResultType>; |
| | | |
| | | /*! |
| | | A BFTaskCompletionSource represents the producer side of tasks. |
| | |
| | | Attempting to set this for a completed task will raise an exception. |
| | | @param result The result of the task. |
| | | */ |
| | | - (void)setResult:(nullable ResultType)result; |
| | | - (void)setResult:(nullable ResultType)result NS_SWIFT_NAME(set(result:)); |
| | | |
| | | /*! |
| | | Completes the task by setting the error. |
| | | Attempting to set this for a completed task will raise an exception. |
| | | @param error The error for the task. |
| | | */ |
| | | - (void)setError:(NSError *)error; |
| | | |
| | | /*! |
| | | Completes the task by setting an exception. |
| | | Attempting to set this for a completed task will raise an exception. |
| | | @param exception The exception for the task. |
| | | |
| | | @deprecated `BFTask` exception handling is deprecated and will be removed in a future release. |
| | | */ |
| | | - (void)setException:(NSException *)exception |
| | | __attribute__((deprecated("`BFTask` exception handling is deprecated and will be removed in a future release."))); |
| | | - (void)setError:(NSError *)error NS_SWIFT_NAME(set(error:)); |
| | | |
| | | /*! |
| | | Completes the task by marking it as cancelled. |
| | |
| | | Sets the result of the task if it wasn't already completed. |
| | | @returns whether the new value was set. |
| | | */ |
| | | - (BOOL)trySetResult:(nullable ResultType)result; |
| | | - (BOOL)trySetResult:(nullable ResultType)result NS_SWIFT_NAME(trySet(result:)); |
| | | |
| | | /*! |
| | | Sets the error of the task if it wasn't already completed. |
| | | @param error The error for the task. |
| | | @returns whether the new value was set. |
| | | */ |
| | | - (BOOL)trySetError:(NSError *)error; |
| | | |
| | | /*! |
| | | Sets the exception of the task if it wasn't already completed. |
| | | @param exception The exception for the task. |
| | | @returns whether the new value was set. |
| | | |
| | | @deprecated `BFTask` exception handling is deprecated and will be removed in a future release. |
| | | */ |
| | | - (BOOL)trySetException:(NSException *)exception |
| | | __attribute__((deprecated("`BFTask` exception handling is deprecated and will be removed in a future release."))); |
| | | - (BOOL)trySetError:(NSError *)error NS_SWIFT_NAME(trySet(error:)); |
| | | |
| | | /*! |
| | | Sets the cancellation state of the task if it wasn't already completed. |