A fire-and-forget operation starts asynchronous work without awaiting it or consuming its completion or result. It suits background tasks whose caller does not need an immediate response. section 12.1.1
Consider this pattern when:
- The work can continue in the background of the application. section 12.1.1
- The operation performs external I/O, such as writing to a file, and produces no value for the caller. section 12.1.1 section 12.2.2
- The application can divide work into smaller jobs and execute them in parallel. section 12.1.1
In .NET, a non-generic Task represents asynchronous work without a returned value. F# can also represent that absence of a result with Task<unit>. Unlike a value-producing Task<string>, the important concern is whether the operation completes successfully or fails. section 12.2.2
A no-result asynchronous operation
A file-writing operation is a representative no-result task: its success is completion, while failure manifests as an exception. When a task is retained rather than forgotten, inspect properties such as Status, IsCompleted, IsFaulted, and Exception to understand its execution state. section 12.2.2
open System.IO
open System.Threading.Tasks
File.WriteAllText("foo.txt", "Hello, world") #1
let text : string = File.ReadAllText "foo.txt" #2
let textAsync : Task<string> = File.ReadAllTextAsync "foo.txt" #3
Compare synchronous file access with File.ReadAllTextAsync and observe the Task<string> returned by asynchronous I/O. section 12.2.2

