You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for each connection a running listener instance gets it calls an execute connection method and does not await it, and that method's first line is an awaited task yield method. So my question is, what is the reason behind doing this instead of just calling Task.Run and passing the connection delegate's method.
The text was updated successfully, but these errors were encountered:
There's 0 allocations when you do it this way. When you use Task.Run there's a new Task allocation, a delegate allocation and a closure allocation (because there's state that would be captured here).
Makes sense. Thank you for this response. I asked this because I had similar code where I used Task.Run, I will refactor it to how it is done in Bedrock.
for each connection a running listener instance gets it calls an execute connection method and does not await it, and that method's first line is an awaited task yield method. So my question is, what is the reason behind doing this instead of just calling
Task.Run
and passing the connection delegate's method.The text was updated successfully, but these errors were encountered: