File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44using System . IO ;
55using System . Net ;
66using System . Net . Http ;
7+ using System . Runtime . CompilerServices ;
78using System . Text . Json ;
89using System . Threading . Tasks ;
910using Orb . Exceptions ;
@@ -161,12 +162,17 @@ internal StreamingHttpResponse(
161162 this . CancellationToken = response . CancellationToken ;
162163 }
163164
164- public IAsyncEnumerable < T > Enumerate ( Threading ::CancellationToken cancellationToken = default )
165+ public async IAsyncEnumerable < T > Enumerate (
166+ [ EnumeratorCancellationAttribute ] Threading ::CancellationToken cancellationToken = default
167+ )
165168 {
166169 using var cts = Threading ::CancellationTokenSource . CreateLinkedTokenSource (
167170 this . CancellationToken ,
168171 cancellationToken
169172 ) ;
170- return this . _enumerate ( cts . Token ) ;
173+ await foreach ( var item in this . _enumerate ( cts . Token ) )
174+ {
175+ yield return item ;
176+ }
171177 }
172178}
You can’t perform that action at this time.
0 commit comments