One of the most exciting features of .NET Core 3.0 and C# 8.0 has been the addition of IAsyncEnumerable<T> (aka async streams). But what's so...
For further actions, you may consider blocking this person and/or reporting abuse
This is cool. Can you write something about SignalR? Thank you.
Sure. Anything in particular that you want to read about?
I would love to read about a current state of SignalR / SSE (Server Sent Events) / gRPC / anything else? - features, gaps, areas to apply/consider using for. What is implemented / supported in .NET Core 3 for "realtime" like apps.
The use of IAsyncEnumerable in a SignalR application. Especially regarding clients communicating to each other. Thank you
It's great. I love SignalR!!
I would love to read about singalR
Is there any way that u can show with stopwatch or with memory consumption matching, showing old vs new way is much efficient?
I don't think it will be more efficient in that sense - it blocks less threads so your server can scale better (await more IO bound operations like the DB calls here)
If you use this for algorithms (CPU bound operations) the runtime will probably be worse (there surely is even more overhead than the one produced by async/awaits state machines)
Do you know how does it work under the hood? I mean, in your example you pass query like
select * from...
but, since it's lazy loaded, what's the actual query executed?How I see it is it retrieves records one by one, which is something similar to looping through
IQueryable
.Am I wrong? If so, how does it work exactly?
I don't know exactly how this works with other DB servers but MSSQL uses so called TDS (Tabular Data Stream) protocol to deliver results which is a stream of data rows. This allows asynchronous stream processing within .Net Core applications leveraging IAsyncEnumerable<>.
Can you provide an F# example? I've been looking for a way to return an asynSeq.
That's awesome! Thanks for sharing!
I'm new to this whole progg. stuff but I know there isn't no one out there better than Microsoft. Go .NET !!! hope I get to use this new feature one day
again GO GO .NET
Nice article, thanks. A thing I wonder when you are using IAsyncEnumerable in controller as you return type of a route. How do you handle the cas where you want to return a NotFoundResult when no items are in the IAsyncEnumerable.
Does the new interface support on demand pull?
I.e. what happens if the table contains 100 records but the client uses Take(15)?
The
MoveNextAsync
method is called 15 times. Wether or not it does something is an implementation detail.This article very nice. Useful and easy for understand ! Thank Chu !
That's great! It's very helpful. Thanks for sharing.