and other advantages.
It is the combination of these advantages, based on sanic, the integration of a number of popular libraries to build micro-services. The Sanic framework is a similar asynchronous flask framework, simple and lightweight, and has a high performance.
This project is a micro-service framework based on Sanic.
Characteristics
Use
1m Test @ http://127.0.0.1:8080 TenThreads and $connections Thread Stats Avg Stdev Max+/-Stdev Latency147.44ms $.17ms467.54ms86.25%Req/sec141.40 57.52 202.00 65.17%81818Requestsinch 1.00m, -. 15MB Read Socket errors:connect0, read1,Write 0, timeout0Requests/SEC:1361.25Transfer/SEC:275.17KBPython3 began to support the native co-process to handle the event loop, although Tornado also support, but for convenience, directly with the fastest sanic
return JSON data from the background, and the front desk will hand it to jquery, haha!! The jquery asynchronous request sets the type (typically this configuration property) to "JSON", or the $.getjson () method to get the server back, so the eval () method is not needed because the result is already a JSON object, just call the object directly, Here is an example of the $.getjson Method 1 code as follows:?varData= "{root: [{name: ' 1 ', Value: ' 0 '}, {name: ' 6101 ', Value: ' Beijing '}, {nam
asynchronous requests set the type (usually this Configuration Attribute) to "json", or use $. the getJSON () method does not need the eval () method to obtain the server response, because the result is already a json object. You only need to call this object directly. Here, $. the getJSON method is used as an example.
Example 1
The Code is as follows:
Var data = "{root: [{name: '1', value: '0'}, {name: '000000', value: 'beijing'}, {name: '20140901', value: 'tianjin City '}, {name: '20160301',
multi-threading, do not like the style of the co-process of the answer is obviously not the topic of discussion. My main question is:If Python doesn't take Gil, I think the ideal model for the future should be multi-process + co-asyncio+aiohttp. Uvloop and Sanic and 500lines a reptile project has begun to do so. Do not discuss compatibility, the above view is correct, there are some scenarios can not replace multi-threaded.Async has a lot of scenario
'},
{name: ' 6106 ', Value: ' Yanan '},
{name: ' 6107 ', Value: ' Hanzhong '},
{name: ' 6108 ', Value: ' Yulin '},
{name: ' 6109 ', Value: ' Ankang '},
{name: ' 6110 ', Value: ' Shangluo '}
]
Jquery
$.getjson ("http://sanic.cnblogs.com/", {param: "sanic"},function (data) {
//The data returned here is already a JSON object
// The following other actions
are the same as the first case $.each (Data.root,function (idx,item) {
if
Python 3.5+ Web server, designed for acceleration. Sanic supports asynchronous request processing, which means you can use some of the async/await syntax in Python 3.5: [Github 8028 stars, provided by Channel Cat and Eli Uriegas]Https://github.com/channelcat/sanicNo 5:python-fireA library that can automatically generate a command line interface (CLI) from any Python object. [Github 7775 stars, David Bieber from Google Brain]Https://github.com/channel
Assistant (v0.6+): Open Source Home automation platformRun on Python 3 [GitHub 11357 stars]. Provided by Paulus Schoutsen
second place
Pytorch: Strong GPU accelerates tensor and dynamic neural network in Python [GitHub 11019 stars]. Provided by Adam Paszke and other members of the Pytorch team
third place
Grumpy: A Python source code decompile and run [GitHub 8367 stars]. Provided by Dylan Trotter and other members of Google
Fourth place
Sanic
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.