Home

Is IAsyncEnumerable<T> supported?

When I run a query that's an expression that's a generic instantiation of type IAsyncEnumerable<T> then the rich text result simply dumps the individual objects (instead of in a tabular format as it does for IEnumerable<T> and IObservable<T> types). When choosing the option to send the result to a Data Grid, it simply dumps the enumerator with the single property of Current. So my question is, is IAsyncEnumerable<T> supported at all, and if yes, then in which ways?

I tested with System.Interactive.Async 3.1.1.

Comments

  • When I go to Help then What's New then the displayed document says that support was added in Version 4.42/2.42:
    custom IObservable implementations and IAsyncEnumerable (from Interactive Extensions) when dumped
    So then my question is, what level of support is there for dump? Is it supposed to be on par with IEnumerable<T> and IObservable<T> or something else?
  • Thanks for reporting - this is a bug and will be fixed for the next build.
  • Thanks for fixing that so quickly! Will give it a spin this week.
  • I tried the latest beta and it seems to fail. I created the following simple expression query together with a reference to the System.Interactive.Async 3.1.1 NuGet package:
    AsyncEnumerable.Range(1, 10)
    Running threw the MissingMethodException exception with the following details:
    Constructor on type 'LINQPad.ObjectGraph.ToObservableObservable`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' not found.
    at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
    at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
    at System.Activator.CreateInstance(Type type, Object[] args)
    at UserQuery
    at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    at System.Threading.ThreadHelper.ThreadStart()
    The tested LINQPad version was 5.20.02.
  • Thanks for fixing this, Joe. Looking good now in the latest beta!
  • AsyncEnumerable.Range(1, 10)
    now works in the rich text mode, but data grid throws
    
    _Exception has been thrown by the target of an invocation. ---_ System.InvalidOperationException_ Enumerator is in an invalid state   at System.Linq.AsyncEnumerable.AsyncIterator`1.get_Current()   --- End of inner exception stack trace ---   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)   at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)   at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)   at LINQPad.UI.ExplorerGrid.GetProp(PropertyInfo pi, Object o)
    
Sign In or Register to comment.