Comments (6)
I am reopening this issue because and marking it as an enhacement to change calls that can be changed to ConfigureAwait(false) i.e. those that don't require context. Are there any other specific recommendations that you might want to suggest @kdblocher ?
from embedio.
Do you have a pull request that we may use to implement your proposed changes?
from embedio.
I can see if I can put one together. I thought it might be at least useful for you guys to read up about this topic, since the pattern is becoming a lot more commonplace.
from embedio.
There are still several problematic uses of Task.Factory.StartNew and sync-over-async antipatterns throughout the code, but I don't think they're fixed easily (from the outside). I still suggest you take a look through the blog (for that matter, any of Stephen Cleary's writing) and read some of the common suggestions. Most are applicable in your case.
See http://stackoverflow.com/a/36355946 and https://msdn.microsoft.com/en-us/magazine/jj991977.aspx for more information.
from embedio.
@mariodivece yes: follow the "async is viral" approach - e.g. everything lower-level that is asynchronous should be called by asynchronous methods itself. This is the most performant, and the cleanest. (I actually tried to do this with your code but ran into a couple of pitfalls.)
I can add a couple of commits with small changes to demonstrate.
from embedio.
@kdblocher check my latest commits, I've been updating the code to a better async/await approach.
from embedio.
Related Issues (20)
- Cannot control charset in ContentType header HOT 3
- How to send statuscode 202 HOT 1
- EmbedIO 3.5.0 NuGet package references wrong/old version of Unosquare.Swan.Lite HOT 22
- System.ObjectDisposedException when processing multiple requests at once HOT 2
- WithZipFile should open a read only handle(or have the option to) HOT 2
- FileModule or StaticFolderModule get stuck returning medium files HOT 4
- Add XML as response type
- EmbedIO Dual-Stack Localhost Listener Causes Empty Replies HOT 1
- How can I custom the Server header HOT 2
- Disable request logging only
- Cookies issue
- EmbedIO.Samples console app does not work when PublishAot is set to true HOT 2
- Web Server does not work in Xamarin.iOS (IOS-17) HOT 3
- How to report progess via api - event-stream
- HttpContext.OnClose not firing HOT 1
- Getting rid of double quotes around strings in a Web API response (turning off JSON serialization) HOT 1
- Issue Serving Static Folder Xamarin ( 3.5.2) Forms on Android
- Request.Url mixing up http and https
- server stop responding after some time HOT 4
- The return array is empty. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from embedio.