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)
I love people and everything good. And I want to positively influence people and be influenced by positive people. I am in love with software development using .NET Technologies.
I'm a Product Manager at Microsoft working on Azure Container Apps and Azure Static Web Apps. I also worked on Azure Functions and was a Cloud Developer Advocate.
Location
Vancouver, Canada
Work
Program Manager - Azure Container Apps and Static Web Apps at Microsoft
World-class .NET Contractor. Top 1% on Stack Overflow. Top 3% of Freelance Developers. 9 Microsoft MVP Awards. My clients call me the Coding Machine. :)
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.
I love people and everything good. And I want to positively influence people and be influenced by positive people. I am in love with software development using .NET Technologies.
Call me Majid !
I am in between Junior Software Engineer -> Software Engineer
Love to code in Python, C# and Asp.Net Core -
Writing about C#-Asp.Net Core -Python- Data Structures - Algorithms
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?
Currently developing futuristic smart-device, IoT connected, highway construction site safety system in EU.
Used to work on infrastructure, application architecture and cloud engineering.
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<>.
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
I am a software developer living in Bordeaux. I am a .NET and Azure enthusiast, primarly coding in C# but I like to discover other languages and technologies too.
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.
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)
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
I would love to read about singalR
It's great. I love SignalR!!
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<>.
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
That's awesome! Thanks for sharing!
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.
Can you provide an F# example? I've been looking for a way to return an asynSeq.
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
MoveNextAsyncmethod 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.