{"id":296780,"date":"2020-01-05T21:00:11","date_gmt":"2020-01-05T21:00:11","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=296780"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=296780","title":{"rendered":"\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 ASGI: \u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439 \u0432\u0435\u0431-\u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b Python"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/482936\/\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/florimond.dev\/blog\/articles\/2019\/08\/introduction-to-asgi-async-python-web\/\">&quot;Introduction to ASGI: Emergence of an Async Python Web Ecosystem&quot;<\/a> \u0430\u0432\u0442\u043e\u0440\u0430 Florimond Manca.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_f\/wj\/ns\/_fwjnsbv7x23ocxkywukxkhn_pu.jpeg\"\/><br \/>  <em>&quot;\u0427\u0435\u0440\u0435\u043f\u0430\u0445\u0438 \u0440\u044f\u0434\u043e\u043c \u0441 \u0432\u043e\u0434\u043e\u0435\u043c\u043e\u043c&quot;, Ricard Baraham \u043d\u0430 <a href=\"https:\/\/images.unsplash.com\/photo-1482642302383-7ba0f8012849?ixlib=rb-1.2.1&amp;ixid=eyJhcHBfaWQiOjEyMDd9&amp;auto=format&amp;fit=crop&amp;w=1051&amp;q=80\">unsplash.com<\/a><\/em><\/p>\n<p>  <\/p>\n<p>Python \u043d\u0435 \u0437\u0430\u043c\u044b\u043a\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 Data Science, \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043d\u0430 Python \u0432\u0435\u0440\u043d\u0443\u043b\u0430\u0441\u044c \u0441 \u043d\u043e\u0432\u044b\u043c \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c \u0432\u0438\u0442\u043a\u043e\u043c \u0432 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0438 \u044f\u0437\u044b\u043a\u0430!<\/p>\n<p>  <\/p>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043c\u043d\u043e\u0433\u043e \u0432\u0430\u0436\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0432 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430 Python. \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 \u044d\u0442\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <a href=\"https:\/\/asgi.readthedocs.io\/en\/latest\/\">ASGI<\/a> \u2014 Asynchronous Standard Gateway Interface.<\/p>\n<p>  <\/p>\n<p>\u042f \u0443\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b ASGI \u0432 \u043c\u043e\u0435\u043c \u0431\u043b\u043e\u0433\u0435, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0433\u0434\u0430 \u0430\u043d\u043e\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043b <a href=\"https:\/\/florimond.dev\/blog\/articles\/2018\/12\/how-i-built-a-web-framework-and-became-an-open-source-maintainer\/\">Bocadillo<\/a> (<em>\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 open-source \u0432\u0435\u0431-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043d\u0430 Python \u2014 \u043f\u0440\u0438\u043c.\u043f\u0435\u0440.<\/em>) \u0438 <a href=\"https:\/\/florimond.dev\/blog\/articles\/2019\/07\/introducing-tartiflette-starlette\/\">tartiflette-starlette<\/a> (<em>\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f GraphQL API \u043f\u043e\u0432\u0435\u0440\u0445 HTTP \u0447\u0435\u0440\u0435\u0437 ASGI \u2014 \u043f\u0440\u0438\u043c.\u043f\u0435\u0440.<\/em>), \u043d\u043e \u044f \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u0438\u0441\u0430\u043b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043e \u043d\u0435\u043c. \u0422\u0435\u043f\u0435\u0440\u044c \u044f \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u044e.<\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430\u0446\u0435\u043b\u0435\u043d\u0430 \u043d\u0430 \u043b\u044e\u0434\u0435\u0439, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0445\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c\u0438 \u0442\u0440\u0435\u043d\u0434\u0430\u043c\u0438 \u0432 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430 Python. \u042f \u0445\u043e\u0447\u0443 \u043f\u0440\u0438\u0433\u043b\u0430\u0441\u0438\u0442\u044c \u0432\u0430\u0441 \u043d\u0430 \u044d\u043a\u0441\u043a\u0443\u0440\u0441\u0438\u044e, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 ASGI, \u0438 \u0447\u0442\u043e \u043e\u043d \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0434\u043b\u044f \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432 \u043c\u0438\u0440\u0435 Python.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043c\u044b \u043d\u0430\u0447\u043d\u0435\u043c, \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043b <a href=\"https:\/\/github.com\/florimondmanca\/awesome-asgi\">awesome-asgi<\/a> \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043b\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044e\u0449\u0435\u0439\u0441\u044f \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b ASGI.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h3 id=\"vse-nachalos-s-asyncawait\">\u0412\u0441\u0435 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c \u0441 async\/await<\/h3>\n<p>  <\/p>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 JavaScript \u0438\u043b\u0438 Go, \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f Python \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u043b \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430. \u0414\u043e\u043b\u0433\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u0432 Python \u043c\u043e\u0433\u043b\u043e \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0439 \u0438\u043b\u0438 \u043c\u043d\u043e\u0433\u043e\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043b\u0438\u0431\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a eventlet, gevent \u0438\u043b\u0438 Twisted. (\u0415\u0449\u0435 \u0432 2008 \u0433\u043e\u0434\u0443 \u0443 Twisted \u0431\u044b\u043b API \u0434\u043b\u044f \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u043a\u043e\u0440\u0443\u0442\u0438\u043d, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0432\u0438\u0434\u0435 <a href=\"http:\/\/blog.mekk.waw.pl\/archives\/14-Twisted-inlineCallbacks-and-deferredGenerator.html\"><code>inlineCallbacks<\/code> \u0438 <code>deferredGenerator<\/code><\/a>)<\/p>\n<p>  <\/p>\n<p>\u0412\u0441\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c \u0432 Python 3.4+. \u0412 Python 3.4 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0432\u043a\u043b\u044e\u0447\u0438\u043b\u0438 <a href=\"https:\/\/www.python.org\/dev\/peps\/pep-3156\">asyncio<\/a>, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u043a\u043e\u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043c\u043d\u043e\u0433\u043e\u0437\u0430\u0434\u0430\u0447\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0438 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 <code>yield from<\/code>.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0437\u0436\u0435 \u0432 Python 3.5 <a href=\"https:\/\/www.python.org\/dev\/peps\/pep-0492\/\">\u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441<\/a> <code>async\/await<\/code>. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043a\u043e\u0440\u0443\u0442\u0438\u043d\u044b, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0435 \u043e\u0442 \u043b\u0435\u0436\u0430\u0449\u0435\u0439 \u0432 \u043e\u0441\u043d\u043e\u0432\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a \u0437\u043e\u043b\u043e\u0442\u043e\u0439 \u043b\u0438\u0445\u043e\u0440\u0430\u0434\u043a\u0435 \u0432\u043e\u043a\u0440\u0443\u0433 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c\u0430 \u0432 Python.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u0430\u043b\u0430\u0441\u044c \u0441\u0443\u043c\u0430\u0441\u0448\u0435\u0434\u0448\u0430\u044f \u0433\u043e\u043d\u043a\u0430! \u0421 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0432\u044b\u043f\u0443\u0441\u043a\u0430 \u0432\u0435\u0440\u0441\u0438\u0438 3.5 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u0432\u043e\u043a\u0440\u0443\u0433. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043c\u043d\u043e\u0433\u0438\u0435 \u0438\u0437 \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0445\u0441\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u044b \u0432 <a href=\"https:\/\/github.com\/aio-libs\">aio-libs<\/a> \u0438 <a href=\"https:\/\/github.com\/timofurrer\/awesome-asyncio\">awesome-asyncio<\/a>.<\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u044b \u0434\u043e\u0433\u0430\u0434\u0430\u043b\u0438\u0441\u044c, \u044d\u0442\u043e \u0442\u0430\u043a\u0436\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u044b \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 Python \u0434\u0432\u0438\u0436\u0443\u0442\u0441\u044f \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u0438. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0432\u0441\u0435 \u043a\u0440\u0443\u0442\u044b\u0435 \u0440\u0435\u0431\u044f\u0442\u0430 \u0434\u0435\u043b\u0430\u044e\u0442 \u044d\u0442\u043e! (<a href=\"https:\/\/github.com\/django\/deps\/blob\/master\/accepted\/0009-async.rst\">\u0414\u0430\u0436\u0435 Django<\/a>) (<em>Habr: <a href=\"https:\/\/habr.com\/ru\/post\/461493\/\">Django 3.0 \u0431\u0443\u0434\u0435\u0442 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c<\/a>, \u0443\u0436\u0435 \u0432\u044b\u0448\u043b\u0430 02.12.2019 \u2014 \u043f\u0440\u0438\u043c.\u043f\u0435\u0440.<\/em>)<\/p>\n<p>  <\/p>\n<h3 id=\"obzor-asgi\">\u041e\u0431\u0437\u043e\u0440 ASGI<\/h3>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043a\u0430\u043a \u0436\u0435 ASGI \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0441\u0435 \u044d\u0442\u043e?<\/p>\n<p>  <\/p>\n<p>\u0412\u0435\u0440\u0445\u043d\u0435\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u043e ASGI \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0441\u0432\u044f\u0437\u0443\u044e\u0449\u0435\u0435 \u0437\u0432\u0435\u043d\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c Python \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c. \u041e\u043d \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043d\u044b\u0445 \u0438\u0434\u0435\u0439 \u0438\u0437 <a href=\"https:\/\/www.python.org\/dev\/peps\/pep-3333\">WSGI<\/a>, \u0438 \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0435\u0433\u043e \u043f\u0440\u0435\u0435\u043c\u043d\u0438\u043a \u0441\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u0442\u0430\u043a \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043d\u0430 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0435:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mx\/8p\/vd\/mx8pvdbvnscbq28i8mwmuj5ntu0.png\"\/><\/p>\n<p>  <\/p>\n<p>\u041d\u0430 \u043e\u0447\u0435\u043d\u044c \u0432\u044b\u0441\u043e\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 ASGI \u2014 \u044d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0434\u043b\u044f \u043a\u043e\u043c\u043c\u0443\u043d\u0438\u043a\u0430\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438. \u041d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0432\u0441\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435.<\/p>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u043a\u0430\u043a ASGI \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 <a href=\"https:\/\/asgi.readthedocs.io\/en\/latest\/specs\/main.html#overview\">\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e ASGI<\/a>.<\/p>\n<p>  <\/p>\n<p>ASGI \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432:<\/p>\n<p>  <\/p>\n<ol>\n<li>\u0421\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 (<em>protocol server<\/em>) \u2014 \u0441\u043b\u0443\u0448\u0430\u0435\u0442 \u0441\u043e\u043a\u0435\u0442\u044b \u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0438\u0445 \u0432 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f.<\/li>\n<li>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (<em>application<\/em>), \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0436\u0438\u0432\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430, \u0435\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u0445 \u043f\u043e \u043c\u0435\u0440\u0435 \u0438\u0445 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f.<\/li>\n<\/ol>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u0442\u043e, \u0447\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 ASGI \u2014 \u044d\u0442\u043e \u0444\u043e\u0440\u043c\u0430\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0438 \u0442\u043e, \u043a\u0430\u043a \u044d\u0442\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/cw\/uz\/ji\/cwuzjibslnldwwt37-ucuh5v6by.png\"\/><\/p>\n<p>  <\/p>\n<p>\u0412 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0435 \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0434\u0435\u0442\u0430\u043b\u0435\u0439. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 <a href=\"https:\/\/asgi.readthedocs.io\/en\/latest\/specs\/www.html\">\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e HTTP \u0438 WebSocket<\/a>.<\/p>\n<p>  <\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0445\u043e\u0442\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0441\u0438\u043b\u044c\u043d\u043e \u0444\u043e\u043a\u0443\u0441\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c, ASGI \u0443\u0434\u0430\u0435\u0442\u0441\u044f \u043e\u0445\u0432\u0430\u0442\u0438\u0442\u044c \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u041c\u044b \u0434\u043e\u0431\u0435\u0440\u0435\u043c\u0441\u044f \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u0447\u0435\u0440\u0435\u0437 \u043c\u0438\u043d\u0443\u0442\u0443, \u043d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430\u2026<\/p>\n<p>  <\/p>\n<h3 id=\"osnovy-asgi\">\u041e\u0441\u043d\u043e\u0432\u044b ASGI<\/h3>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0443\u0432\u0438\u0434\u0435\u043b\u0438, \u043a\u0430\u043a ASGI \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0432\u0435\u0431-\u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0443 Python, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u043e\u043f\u043b\u043e\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<p>  <\/p>\n<p>ASGI \u043e\u043f\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c: \u043a\u043e\u0433\u0434\u0430 \u043a\u043b\u0438\u0435\u043d\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0417\u0430\u0442\u0435\u043c \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043d\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442.<\/p>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0434\u0435\u0441\u044c \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 <em>\u0432\u044b\u0437\u043e\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/em>, \u043a\u0430\u043a \u0435\u0441\u043b\u0438 \u0431\u044b \u043e\u043d\u043e \u0431\u044b\u043b\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439, \u0442.\u0435. \u0447\u0435\u043c-\u0442\u043e, \u0447\u0442\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0432\u0441\u0435, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 ASGI-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u2014 \u044d\u0442\u043e <em>callable<\/em> (\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442). \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043e\u043f\u044f\u0442\u044c \u0436\u0435, <a href=\"https:\/\/asgi.readthedocs.io\/en\/latest\/specs\/main.html#applications\">\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 ASGI<\/a>:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">async def app(scope, receive, send):     ...<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u2014 \u044d\u0442\u043e \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u043e, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 &quot;I&quot; \u0432 &quot;ASGI&quot;: \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u043c\u043e\u0433 \u0435\u0433\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<ul>\n<li><code>scope<\/code> \u2014 \u044d\u0442\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044c, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435. \u0415\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f <a href=\"https:\/\/asgi.readthedocs.io\/en\/latest\/specs\/www.html#connection-scope\">HTTP<\/a> \u0438 <a href=\"https:\/\/asgi.readthedocs.io\/en\/latest\/specs\/www.html#id1\">WebSocket<\/a> \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439.<\/li>\n<li><code>receive<\/code> \u2014 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u0445 ASGI.<\/li>\n<li><code>send<\/code> \u2014 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043e \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u0445 ASGI.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041f\u043e \u0441\u0443\u0442\u0438, \u044d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c (<code>receive()<\/code>) \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c (<code>send()<\/code>) \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u043a\u0430\u043d\u0430\u043b\u0443 \u0441\u0432\u044f\u0437\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0432 \u043a\u0430\u043a\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 (\u0438\u043b\u0438 <code>scope<\/code>) \u044d\u0442\u043e\u0442 \u043a\u0430\u043d\u0430\u043b \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d.<\/p>\n<p>  <\/p>\n<p>\u041d\u0435 \u0437\u043d\u0430\u044e \u043a\u0430\u043a \u0432\u0430\u043c, \u043d\u043e \u043c\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043d\u0440\u0430\u0432\u044f\u0442\u0441\u044f \u043e\u0431\u0449\u0438\u0439 \u0432\u0438\u0434 \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u044d\u0442\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430.<\/p>\n<p>  <\/p>\n<h3 id=\"pokazhite-kod\">\u041f\u043e\u043a\u0430\u0436\u0438\u0442\u0435 \u043a\u043e\u0434!<\/h3>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 ASGI, \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 \u0433\u043e\u043b\u043e\u043c ASGI, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 HTTP-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0435 <a href=\"https:\/\/www.uvicorn.org\/\">uvicorn<\/a> (\u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 ASGI-\u0441\u0435\u0440\u0432\u0435\u0440):<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">async def app(scope, receive, send):   assert scope[&quot;type&quot;] == &quot;http&quot;   await send({     &quot;type&quot;: &quot;http.response.start&quot;,     &quot;status&quot;: 200,     &quot;headers&quot;: [       [b&quot;content-type&quot;, b&quot;text\/plain&quot;],     ]   })   await send({     &quot;type&quot;: &quot;http.response.body&quot;,     &quot;body&quot;: b&quot;Hello, world!&quot;,   })<\/code><\/pre>\n<p>  <\/p>\n<p><em>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u2014 <a href=\"https:\/\/glitch.com\/edit\/#!\/asgi-hello-world\">https:\/\/glitch.com\/edit\/#!\/asgi-hello-world<\/a><\/em><\/p>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <code>send()<\/code> \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 HTTP-\u043e\u0442\u0432\u0435\u0442\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0443: \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438, \u0430 \u0437\u0430\u0442\u0435\u043c \u0442\u0435\u043b\u043e \u043e\u0442\u0432\u0435\u0442\u0430.<\/p>\n<p>  <\/p>\n<p>\u042f \u043f\u0440\u0438\u0437\u043d\u0430\u044e, \u0447\u0442\u043e \u0438\u0437-\u0437\u0430 \u0432\u0441\u0435\u0445 \u044d\u0442\u0438\u0445 \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 \u0438 \u043d\u0435\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0445 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0433\u043e\u043b\u044b\u0439 ASGI \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u0435\u043d \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b.<\/p>\n<p>  <\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0435\u0441\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f \u2014 \u0438 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u043e\u0433\u0434\u0430 \u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043e <a href=\"https:\/\/www.starlette.io\/\">Starlette<\/a>.<\/p>\n<p>  <\/p>\n<p>Starlette \u2014 \u043f\u043e\u0438\u0441\u0442\u0438\u043d\u0435 \u0444\u0430\u043d\u0442\u0430\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u0438, \u043f\u043e-\u043c\u043e\u0435\u043c\u0443, \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b ASGI.<\/p>\n<p>  <\/p>\n<p>\u041a\u0440\u0430\u0442\u043a\u043e, \u043e\u043d \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u0431\u043e\u0440 \u0432\u044b\u0441\u043e\u043a\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438 \u043e\u0442\u0432\u0435\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0430\u0431\u0441\u0442\u0440\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u0435\u0442\u0430\u043b\u0435\u0439 ASGI. \u0412\u043e\u0442, \u0432\u0437\u0433\u043b\u044f\u043d\u0438\u0442\u0435 \u043d\u0430 &quot;hello world&quot; \u0432 Starlette:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\"># app.py from starlette.responses import PlainTextResponse  async def app(scope, receive, send):   assert scope[&quot;type&quot;] == &quot;http&quot;   response = PlainTextResponse(&quot;Hello, world!&quot;)   await response(scope, receive, send)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 Starlette \u0435\u0441\u0442\u044c \u0432\u0441\u0435, \u0447\u0442\u043e \u0432\u044b \u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0435 \u043e\u0442 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0433\u043e \u0432\u0435\u0431-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u2014 routing, middleware \u0438 \u0442.\u0434. \u041d\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u044d\u0442\u0443 \u0443\u0440\u0435\u0437\u0430\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u043c\u0435\u043a\u043d\u0443\u0442\u044c \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0438\u043b\u0443 ASGI, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f\u2026<\/p>\n<p>  <\/p>\n<h3 id=\"cherepahi-na-vsem-puti\">\u0427\u0435\u0440\u0435\u043f\u0430\u0445\u0438 \u043d\u0430 \u0432\u0441\u0435\u043c \u043f\u0443\u0442\u0438<\/h3>\n<p>  <\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0438 \u043c\u0435\u043d\u044f\u044e\u0449\u0430\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438\u0433\u0440\u044b \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f ASGI \u2014 \u044d\u0442\u043e &quot;<a href=\"https:\/\/simonwillison.net\/2019\/Jun\/23\/datasette-asgi\/\">\u0427\u0435\u0440\u0435\u043f\u0430\u0445\u0438 \u043d\u0430 \u0432\u0441\u0435\u043c \u043f\u0443\u0442\u0438<\/a>&quot;, \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b (\u044f \u0434\u0443\u043c\u0430\u044e?) Andrew Godwin, \u0441\u043e\u0437\u0434\u0430\u0432\u0448\u0438\u0439 Django Migrations \u0438 \u0441\u0435\u0439\u0447\u0430\u0441 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0439\u0441\u044f <a href=\"https:\/\/www.youtube.com\/watch?v=oMHrDy62kgE\">\u043f\u0435\u0440\u0435\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 Django \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u0438<\/a>.<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442?<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 ASGI \u044d\u0442\u043e \u0430\u0431\u0441\u0442\u0440\u0430\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0432 \u043a\u0430\u043a\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043c\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u043c\u0441\u044f, \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043b\u044e\u0431\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u0442\u043e \u0435\u0441\u0442\u044c \u0438\u0434\u0435\u044f, \u0447\u0442\u043e ASGI \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0436\u0434\u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438 \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438, \u043d\u043e \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432 \u043b\u044e\u0431\u043e\u0439 \u0442\u043e\u0447\u043a\u0435 \u0441\u0442\u0435\u043a\u0430.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0431\u044a\u0435\u043a\u0442 Starlette <code>Response<\/code> \u044d\u0442\u043e \u0441\u0430\u043c\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 ASGI. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043a\u043e\u0434 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u044b\u0448\u0435 \u0434\u043e \u0442\u0430\u043a\u043e\u0433\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\"># app.py app = PlainTextResponse(&quot;Hello, world!&quot;)<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043b\u0435\u043f\u043e \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442?!<\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u043f\u043e\u0434\u043e\u0436\u0434\u0438\u0442\u0435, \u044d\u0442\u043e \u0435\u0449\u0435 \u043d\u0435 \u0432\u0441\u0435.<\/p>\n<p>  <\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0435 \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 &quot;\u0447\u0435\u0440\u0435\u043f\u0430\u0445 \u043d\u0430 \u0432\u0441\u0435\u043c \u043f\u0443\u0442\u0438&quot; \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u0441\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, middleware, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0438 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u043c\u0438 \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440 \u043f\u043e\u043a\u0430 \u043e\u043d\u0438 \u0432\u0441\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f ASGI.<\/p>\n<p>  <\/p>\n<p>(\u041a \u0442\u043e\u043c\u0443 \u0436\u0435, \u0438\u0437 \u043c\u043e\u0435\u0433\u043e \u043b\u0438\u0447\u043d\u043e\u0433\u043e \u043e\u043f\u044b\u0442\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f <a href=\"https:\/\/bocadilloproject.github.io\/\">Bocadillo<\/a>, \u043f\u0440\u0438\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 ASGI \u043e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e (\u0435\u0441\u043b\u0438 \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430) \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u0447\u0438\u0441\u0442\u043e\u043c\u0443 \u043a\u043e\u0434\u0443)<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c ASGI middleware (\u0442.\u0435. \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u0431\u0435\u0440\u0442\u044b\u0432\u0430\u0435\u0442 \u0434\u0440\u0443\u0433\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435), \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f, \u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u044b\u043b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0437\u0430\u043f\u0440\u043e\u0441:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\"># app.py import time  class TimingMiddleware:     def __init__(self, app):         self.app = app      async def __call__(self, scope, receive, send):         start_time = time.time()         await self.app(scope, receive, send)         end_time = time.time()         print(f&quot;Took {end_time - start_time:.2f} seconds&quot;)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e, \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0438\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u2026<\/p>\n<p>  <\/p>\n<pre><code class=\"python\"># app.py import asyncio from starlette.responses import PlainTextResponse  async def app(scope, receive, send):     await asyncio.sleep(1)     response = PlainTextResponse(&quot;Hello, world!&quot;)     await response(scope, receive, send)  app = TimingMiddleware(app)<\/code><\/pre>\n<p>  <\/p>\n<p>\u2026 \u0438 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u043b\u0448\u0435\u0431\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">$ uvicorn app:app INFO: Started server process [59405] INFO: Waiting for application startup. INFO: Uvicorn running on http:\/\/127.0.0.1:8000 (Press CTRL+C to quit) ... INFO: ('127.0.0.1', 62718) - &quot;GET \/ HTTP\/1.1&quot; 200 Took 1.00 seconds<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u043e\u0441\u0445\u0438\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u0432 <code>TimingMiddleware<\/code> \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u043b\u044e\u0431\u043e\u0435 ASGI-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u0443\u043f\u0435\u0440-\u043f\u0440\u043e\u0441\u0442\u043e\u0435, \u043d\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u044b\u0439, \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 (\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u043e\u0442\u043d\u0438 API \u0438 WebSocket endpoint-\u043e\u0432) \u2014 \u044d\u0442\u043e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043f\u043e\u043a\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 ASGI.<\/p>\n<p>  <\/p>\n<p>(\u0415\u0441\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044f \u044d\u0442\u043e\u0433\u043e middleware \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u043a \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e: <a href=\"https:\/\/github.com\/steinnes\/timing-asgi\">timing-asgi<\/a>.)<\/p>\n<p>  <\/p>\n<h3 id=\"pochemu-eto-dolzhno-volnovat\">\u041f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u043e\u043b\u043d\u043e\u0432\u0430\u0442\u044c?<\/h3>\n<p>  <\/p>\n<p>\u0425\u043e\u0442\u044f \u044f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c, \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u043c\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432 \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 ASGI \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 Python.<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c: \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f \u043f\u0440\u0438\u0440\u043e\u0434\u0430 ASGI \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u0445 <a href=\"https:\/\/www.techempower.com\/benchmarks\/#section=data-r18&amp;hw=ph&amp;test=fortune&amp;l=zijzen-f&amp;w=zik0zh-zik0zj-e7&amp;d=b\">\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u044b\u043c\u0438<\/a> (\u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435, \u0434\u043b\u044f Python) \u2014 \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e 60k-70k \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 (\u043f\u043e\u043b\u0430\u0433\u0430\u044f, \u0447\u0442\u043e Flask \u0438 Django \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e 10-20k \u0432 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438).<\/li>\n<li>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438: \u0441\u0435\u0440\u0432\u0435\u0440\u044b \u0438 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b ASGI \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0432\u0430\u043c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c (WebSocket, Server-Sent Events, HTTP\/2), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0438 WSGI.<\/li>\n<li>\u0421\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c: ASGI \u043a\u0430\u043a \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0443\u0436\u0435 \u043e\u043a\u043e\u043b\u043e 3 \u043b\u0435\u0442, \u0438 \u0432\u0435\u0440\u0441\u0438\u044f 3.0 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0439. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u044d\u0442\u043e\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442\u0441\u044f.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043d\u0435 \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0434\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f. \u041d\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043e\u0447\u0435\u043d\u044c \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u043c\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0443, \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043d\u0430\u0434\u0435\u0436\u0434\u044b, \u0447\u0442\u043e \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0430 ASGI \u043e\u0447\u0435\u043d\u044c \u0441\u043a\u043e\u0440\u043e \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0435\u0442 \u043f\u0430\u0440\u0438\u0442\u0435\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0439\/WSGI \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439.<\/p>\n<p>  <\/p>\n<h3 id=\"gde-mozhno-nayti-komponenty-sovmestimye-s-asgi\">\u0413\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0435 \u0441 ASGI?<\/h3>\n<p>  <\/p>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0432\u0441\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438 \u0431\u043e\u043b\u044c\u0448\u0435 \u043b\u044e\u0434\u0435\u0439 \u0441\u0442\u0440\u043e\u044f\u0442 \u0438 \u0443\u043b\u0443\u0447\u0448\u0430\u044e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 ASGI. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u044d\u0442\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u044b \u0438 \u0432\u0435\u0431-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0438, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c middleware \u0438 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043f\u0440\u043e\u0434\u0443\u043a\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a <a href=\"https:\/\/github.com\/simonw\/datasette\">Datasette<\/a>.<\/p>\n<p>  <\/p>\n<p>\u041d\u0438\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u0432\u0435\u0431-\u0444\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0435\u043d\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/erm\/mangum\">Mangum<\/a>: \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 ASGI \u0434\u043b\u044f AWS Lambda.<\/li>\n<li><a href=\"https:\/\/github.com\/simonw\/datasette-auth-github\">datasette-auth-github<\/a>: \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f GitHub \u0434\u043b\u044f ASGI-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439.<\/li>\n<li><a href=\"https:\/\/github.com\/tartiflette\/tartiflette-starlette\">tartiflette-starlette<\/a> (\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0435\u0433\u043e!): \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 ASGI \u0434\u043b\u044f Tartiflette, \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0433\u043e \u0434\u0432\u0438\u0436\u043a\u0430 GraphQL.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0412\u043e\u0441\u0445\u0438\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c, \u0447\u0442\u043e \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u043e\u0434\u043d\u0430\u043a\u043e, \u043c\u043d\u0435 \u043b\u0438\u0447\u043d\u043e \u0431\u044b\u043b\u043e \u0442\u0440\u0443\u0434\u043d\u043e \u043d\u0435 \u043e\u0442\u0441\u0442\u0430\u0432\u0430\u0442\u044c \u043e\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<p>  <\/p>\n<p>\u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0441\u043e\u0437\u0434\u0430\u043b <a href=\"https:\/\/github.com\/florimondmanca\/awesome-asgi\">awesome-asgi<\/a>. \u042f \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432\u0441\u0435\u043c \u0438\u0434\u0442\u0438 \u0432 \u043d\u043e\u0433\u0443 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0432\u0435\u0449\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0432 \u043c\u0438\u0440\u0435 ASGI. (\u0418 \u0432\u0438\u0434\u044f, \u0447\u0442\u043e \u043e\u043d \u043f\u043e\u0447\u0442\u0438 \u0434\u043e\u0441\u0442\u0438\u0433 100 \u0437\u0432\u0435\u0437\u0434 \u0437\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043d\u0435\u0439, \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u0445 \u043f\u0440\u043e ASGI.)<\/p>\n<p>  <\/p>\n<h3 id=\"vyvody\">\u0412\u044b\u0432\u043e\u0434\u044b<\/h3>\n<p>  <\/p>\n<p>\u0425\u043e\u0442\u044f \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043a\u0430\u043a \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u044f \u0443\u0432\u0435\u0440\u0435\u043d, \u0447\u0442\u043e ASGI \u0437\u0430\u043b\u043e\u0436\u0438\u043b \u043e\u0441\u043d\u043e\u0432\u044b \u0434\u043b\u044f \u043d\u043e\u0432\u043e\u0439 \u044d\u0440\u044b \u0432 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430 Python.<\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e ASGI, \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 <a href=\"https:\/\/github.com\/florimondmanca\/awesome-asgi#publications\">\u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f\u043c\u0438<\/a> (\u0441\u0442\u0430\u0442\u044c\u044f\u043c\u0438 \u0438 \u0432\u044b\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f\u043c\u0438), \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0432 <code>awesome-asgi<\/code>. \u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0442\u0440\u043e\u0433\u0430\u0442\u044c \u0440\u0443\u043a\u0430\u043c\u0438, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u043b\u044e\u0431\u043e\u0439 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432:<\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/www.uvicorn.org\/\">uvicorn<\/a>: \u0441\u0435\u0440\u0432\u0435\u0440 ASGI.<\/li>\n<li><a href=\"https:\/\/www.starlette.io\/\">Starlette<\/a>: ASGI \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a.<\/li>\n<li><a href=\"https:\/\/www.encode.io\/typesystem\/\">TypeSystem<\/a>: \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433 \u0444\u043e\u0440\u043c.<\/li>\n<li><a href=\"https:\/\/www.encode.io\/databases\/\">Databases<\/a>: \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445.<\/li>\n<li><a href=\"https:\/\/github.com\/encode\/orm\">orm<\/a>: \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 ORM.<\/li>\n<li><a href=\"https:\/\/www.encode.io\/httpx\/\">HTTPX<\/a>: \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 HTTP client \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u0432\u044b\u0437\u043e\u0432\u0430 ASGI-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 (\u043f\u043e\u043b\u0435\u0437\u0435\u043d \u043a\u0430\u043a \u043a\u043b\u0438\u0435\u043d\u0442 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f).<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u042d\u0442\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u044b \u0431\u044b\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0435\u0439 Encode, \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0422\u043e\u043c\u043e\u043c \u041a\u0440\u0438\u0441\u0442\u0438 (Tom Christie). \u0415\u0441\u0442\u044c \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u043e <a href=\"https:\/\/discuss.encode.io\/t\/setting-up-a-maintainence-team\/721\/9\">\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 Encode<\/a>, \u0442\u0430\u043a \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043a\u0430\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 open-source, \u0442\u043e \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c!<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0439\u0442\u0435 \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435 \u043e\u0442 \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0432\u0438\u044f \u0432 \u043c\u0438\u0440 ASGI!<\/p>\n<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d() } } }t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>      <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/482936\/\"> https:\/\/habr.com\/ru\/post\/482936\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/482936\/\">\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044e \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/florimond.dev\/blog\/articles\/2019\/08\/introduction-to-asgi-async-python-web\/\">&quot;Introduction to ASGI: Emergence of an Async Python Web Ecosystem&quot;<\/a> \u0430\u0432\u0442\u043e\u0440\u0430 Florimond Manca.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_f\/wj\/ns\/_fwjnsbv7x23ocxkywukxkhn_pu.jpeg\"\/><br \/>  <em>&quot;\u0427\u0435\u0440\u0435\u043f\u0430\u0445\u0438 \u0440\u044f\u0434\u043e\u043c \u0441 \u0432\u043e\u0434\u043e\u0435\u043c\u043e\u043c&quot;, Ricard Baraham \u043d\u0430 <a href=\"https:\/\/images.unsplash.com\/photo-1482642302383-7ba0f8012849?ixlib=rb-1.2.1&amp;ixid=eyJhcHBfaWQiOjEyMDd9&amp;auto=format&amp;fit=crop&amp;w=1051&amp;q=80\">unsplash.com<\/a><\/em><\/p>\n<p>  <\/p>\n<p>Python \u043d\u0435 \u0437\u0430\u043c\u044b\u043a\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 Data Science, \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043d\u0430 Python \u0432\u0435\u0440\u043d\u0443\u043b\u0430\u0441\u044c \u0441 \u043d\u043e\u0432\u044b\u043c \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c \u0432\u0438\u0442\u043a\u043e\u043c \u0432 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u0438 \u044f\u0437\u044b\u043a\u0430!<\/p>\n<p>  <\/p>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043c\u043d\u043e\u0433\u043e \u0432\u0430\u0436\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0432 \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430 Python. \u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432 \u044d\u0442\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <a href=\"https:\/\/asgi.readthedocs.io\/en\/latest\/\">ASGI<\/a> \u2014 Asynchronous Standard Gateway Interface.<\/p>\n<p>  <\/p>\n<p>\u042f \u0443\u0436\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b ASGI \u0432 \u043c\u043e\u0435\u043c \u0431\u043b\u043e\u0433\u0435, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0433\u0434\u0430 \u0430\u043d\u043e\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043b <a href=\"https:\/\/florimond.dev\/blog\/articles\/2018\/12\/how-i-built-a-web-framework-and-became-an-open-source-maintainer\/\">Bocadillo<\/a> (<em>\u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0439 open-source \u0432\u0435\u0431-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043d\u0430 Python \u2014 \u043f\u0440\u0438\u043c.\u043f\u0435\u0440.<\/em>) \u0438 <a href=\"https:\/\/florimond.dev\/blog\/articles\/2019\/07\/introducing-tartiflette-starlette\/\">tartiflette-starlette<\/a> (<em>\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f GraphQL API \u043f\u043e\u0432\u0435\u0440\u0445 HTTP \u0447\u0435\u0440\u0435\u0437 ASGI \u2014 \u043f\u0440\u0438\u043c.\u043f\u0435\u0440.<\/em>), \u043d\u043e \u044f \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043f\u0438\u0441\u0430\u043b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043e \u043d\u0435\u043c. \u0422\u0435\u043f\u0435\u0440\u044c \u044f \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u044e.<\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430\u0446\u0435\u043b\u0435\u043d\u0430 \u043d\u0430 \u043b\u044e\u0434\u0435\u0439, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0445\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c\u0438 \u0442\u0440\u0435\u043d\u0434\u0430\u043c\u0438 \u0432 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0430 Python. \u042f \u0445\u043e\u0447\u0443 \u043f\u0440\u0438\u0433\u043b\u0430\u0441\u0438\u0442\u044c \u0432\u0430\u0441 \u043d\u0430 \u044d\u043a\u0441\u043a\u0443\u0440\u0441\u0438\u044e, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 ASGI, \u0438 \u0447\u0442\u043e \u043e\u043d \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0434\u043b\u044f \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432 \u043c\u0438\u0440\u0435 Python.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043c\u044b \u043d\u0430\u0447\u043d\u0435\u043c, \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043b <a href=\"https:\/\/github.com\/florimondmanca\/awesome-asgi\">awesome-asgi<\/a> \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043b\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044e\u0449\u0435\u0439\u0441\u044f \u044d\u043a\u043e\u0441\u0438\u0441\u0442\u0435\u043c\u044b ASGI.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-296780","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/296780","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=296780"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/296780\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=296780"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=296780"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=296780"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}