I understand in an async method that out and ref can not be used. But I am unclear on the consequences of using Action (or delegates). While I recognize that the value being set in the Action may not be available until after the await, are there any other problems with the below? Are their threading problems? I have googled extensively on this, but can't find clarity anywhere.
protected async Task<gPeriod> MapPeriod(string value, Action<int> setOutput) { (...) //omitted code int x = await MyMethodAsync(value) setOutput(x); return gPeriod; //calculation of this not shown in this example }