Add option to dump enumerables asynchronously?

When you dump an enumerable, the way I understand it running, it enumerates the collection, gathers the count, and if the count exceeds the maximum allowed output amount, truncates the items to be dumped, then generates the full table.

Could an option be added to dump the enumerable asynchronously? i.e., start rendering the table as the collection is being enumerated adding rows to the table (similar to an observable)

Right now, the only way to get this rendering behavior as I know it is to convert to an observable or convert to an async enumerable.


  • Options

    This feature on the TODO list. It's non-trivial to implement in a way that doesn't create thread-safety issues. Specifically, LINQPad would need to first render the whole object graph with placeholders where there are IEnumerables, and then go back and enumerate each sequence in turn, updating the HTML DOM with the values as they appear. There would also need to be safeguards with large object graphs to ensure that this doesn't cause excessive round-tripping (and hence performance issues).

    A side-effect of this behavior would be that when LINQPad encounters a slow IEnumerable, the rendering of any subsequent IEnumerables (including fast ones) would get held up until the slow IEnumerable completes.

Sign In or Register to comment.