Executes the function once for a key and shares the result.
If the same key is already in flight, this call waits for the running execution and returns its result.
| key |
deduplication key. |
| fn |
function to run. |
|
Result.ok(shared result), or Result.error(SingleFlightError.INVALID_ARGUMENT / TYPE_MISMATCH / INTERNAL_STATE). |