Is it possible to write an extension that will take an asynchronous action?
Not directly.
Rx , Rx - push. , , - Action.
await - , Rx, await , .. ForEachAsync ( ), ForEachAsync (, ) .
async , . Rx () , . , /, , .
TPL . - :
var obs = StreamDataFromSql().Buffer(BatchSize);
var buffer = new ActionBlock<IList<T>>(batch => WriteDataAsync(batch));
using (var subscription = obs.Subscribe(buffer.AsObserver()))
await buffer.Completion;
, ; , StreamDataFromSql , ActionBlock. .