@do


Description:

public Result<T,Error> @do<T> (string key, SingleFlightFunc<T> fn)

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.

Parameters:

key

deduplication key.

fn

function to run.

Returns:

Result.ok(shared result), or Result.error(SingleFlightError.INVALID_ARGUMENT / TYPE_MISMATCH / INTERNAL_STATE).