Appearance
Forget Method
Definition
- Namespace:
JASE.Extensions - Assembly:
JASE.Primitives.dll
void Forget(Task task, Action<Exception> onError = null)
csharp
void Forget(Task task, Action<Exception> onError = null)Safely executes a Task without awaiting it.
Parameters
| Name | Description |
|---|---|
onError | Optional delegate invoked if the task throws an exception. |
task | The task to execute in a fire-and-forget manner. |
Remarks
This method observes the task to ensure that any exception is caught and optionally forwarded to the provided error handler. This prevents unobserved task exceptions when intentionally executing fire-and-forget asynchronous operations.