Should generated IAsyncEnumerators clear current value when MoveNext is called? #112181
-
ProblemAt the moment, compiler-generated async enumerators maintain their last yielded value in their state all the way until the next value is available (or terminate conditions are met I believe - eg exceptions, disposal). Consider e.g. this (bad) example:
When a caller fully consumes this
This can be problematic:
If needed, I'm happy to provide a real world example where this behaviour has detrimental effects on system characteristics, but hopefully the problem description above is a sensible enough summary? SuggestionA few options come to mind; would any of them be feasible or worth considering?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
This has already been discussed in dotnet/roslyn#74013 (comment) |
Beta Was this translation helpful? Give feedback.
This has already been discussed in dotnet/roslyn#74013 (comment)