|
|
|
|
|
by dpraburaj
3560 days ago
|
|
I have some questions related to the usage of async. At what scale(in terms of number of users or server load) would choosing async based web frameworks over traditional web frameworks like Django/Pylons make sense? While using async is much easier with the new async/await syntax compared to traditional async solutions like twisted, tornado etc., a lot of popular database connectors and ORMs do not support async currently. Even if the libraries a person needs are present at the moment, there's always the chance that a library maybe required in the future that does not support async and it may not be feasible to write a replacement(either due to the person's lack of expertise or due to lack of funds to hire someone else to write it). In such a case, would using a traditional library by spawning threads to run any blocking operation be a good stop-gap solution(until an async replacement comes along)? |
|
This has been a nightmare in C# which pioneered async/await - a lot of developers are struggling with footguns from mixing sync and async code.
Ryan Dhal said that he picked JavaScript for Node because he was afraid of this and wanted a language without synchronous APIs already built in.
I think Python 3.5+ async/await is fantastic don't get me wrong - but if you want to mix and match I'd recommend getting a second server that runs the synchronous framework and then communicating over network (REST HTTP for example) between the completely asynchronous server and the one running the thread pool.