{"id":292640,"date":"2019-07-27T09:00:34","date_gmt":"2019-07-27T09:00:34","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=292640"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=292640","title":{"rendered":"Tic Tac Toe, \u0447\u0430\u0441\u0442\u044c 6: Flask \u0438 Celery\/RabbitMQ"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c Celery\/RabbitMQ \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0443. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0441\u043d\u043e\u0432\u044b \u0432\u043e\u0437\u044c\u043c\u0435\u043c <a href=\"https:\/\/habr.com\/ru\/post\/460621\/\">\u043f\u0440\u043e\u0435\u043a\u0442 \u0441 Flask&#8217;\u043e\u043c<\/a>. Celery \u0437\u0430\u0439\u043c\u0435\u0442\u0441\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h6 id=\"ustanovka-proekta\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h6>\n<p>  <\/p>\n<p>\u041a\u043b\u043e\u043d\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 \u0441\u0432\u043e\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">git clone https:\/\/github.com\/nomhoi\/tic-tac-toe-part6.git<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">cd tic-tac-toe-part6 docker-compose up -d<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0443 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">cd front npm install npm run-script build<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0431\u0440\u043e\u0443\u0437\u0435\u0440 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <a href=\"http:\/\/localhost\">http:\/\/localhost<\/a>.<\/p>\n<p>  <\/p>\n<h6 id=\"docker-konteynery\">Docker \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b<\/h6>\n<p>  <\/p>\n<p>\u0421\u0435\u0440\u0432\u0438\u0441 <strong>nginx<\/strong> \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. \u0412 \u0441\u0435\u0440\u0432\u0438\u0441 <strong>flask<\/strong> \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u043f\u0430\u043a\u0435\u0442\u0430 Celery \u0432 \u0444\u0430\u0439\u043b requirements.txt \u0438 \u0441\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043f\u0430\u043f\u043a\u0443 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Celery:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">    volumes:       - .\/flask:\/code       - .\/celery\/app\/proj:\/code\/proj<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u043e\u0432\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b <strong>celery<\/strong> \u0438 <strong>rabbit<\/strong>.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">  celery:     container_name: celery     build:       context: celery\/       dockerfile: Dockerfile     volumes:       - .\/celery\/app:\/app     depends_on:       - rabbit     networks:       - backend    rabbit:     container_name: rabbit     hostname: rabbit     image: rabbitmq:3.7.15-alpine     environment:       - RABBITMQ_DEFAULT_USER=admin       - RABBITMQ_DEFAULT_PASS=CT2gNABH8eJ9yVh     ports:       - \"5672:5672\"     networks:       - backend<\/code><\/pre>\n<p>  <\/p>\n<h6 id=\"servis-celery\">\u0421\u0435\u0440\u0432\u0438\u0441 celery<\/h6>\n<p>  <\/p>\n<p>\u0421\u0435\u0440\u0432\u0438\u0441 <strong>celery<\/strong> \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u043d\u0430 \u0431\u0430\u0437\u0435 <a href=\"http:\/\/docs.celeryproject.org\/en\/latest\/getting-started\/next-steps.html#next-steps\">\u044d\u0442\u043e\u0433\u043e \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0430<\/a>. \u041a\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c \u0441 Celery, \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u0442\u0443\u0442-\u0436\u0435 \u043f\u0440\u043e\u0439\u0442\u0438\u0441\u044c \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">$ docker exec -it celery python Python 3.7.3 (default, May 11 2019, 02:00:41) [GCC 8.3.0] on linux Type \"help\", \"copyright\", \"credits\" or \"license\" for more information. &gt;&gt;&gt; from proj.tasks import add &gt;&gt;&gt; add.delay(2, 2) &lt;AsyncResult: 43662174-657f-4dd3-ab1a-22f5950c8794&gt; &gt;&gt;&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 Celery \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d \u0432 \u0432\u0438\u0434\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 <strong>proj<\/strong>. \u0412 \u0437\u0430\u0434\u0430\u0447\u0438 Celery \u0432 \u0444\u0430\u0439\u043b <strong>tasks.py<\/strong> \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u043d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 <strong>getnumber<\/strong>:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">@app.task def getnumber():     return randrange(9)<\/code><\/pre>\n<p>  <\/p>\n<h6 id=\"servis-flask\">\u0421\u0435\u0440\u0432\u0438\u0441 flask<\/h6>\n<p>  <\/p>\n<p>\u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u0442 \u0441\u0435\u0440\u0432\u0438\u0441 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043f\u0430\u043a\u0435\u0442 <strong>Celery<\/strong> \u0438 \u0441\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043f\u0430\u043f\u043a\u0443 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c <strong>proj<\/strong>. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0434\u0432\u0443\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u0445 <strong>flask<\/strong> \u0438 <strong>celery<\/strong>.<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">from flask import Flask, jsonify from proj.tasks import getnumber from proj.celery import app as celery  app = Flask(__name__)  @app.route('\/number') def number():     task = getnumber.delay()     return task.id  @app.route('\/result\/&lt;task_id&gt;') def result(task_id):     task = getnumber.AsyncResult(task_id)     result = task.get(timeout = 3)     response = {         'state': task.state,         'number': result,     }     return jsonify(response)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0435 <strong>number<\/strong> \u043c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0443 <strong>getnumber<\/strong>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0432\u043e\u0440\u043a\u0435\u0440\u0435 <strong>celery<\/strong> \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0437\u0430\u0434\u0430\u0447\u0438. \u0412 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0435 <strong>result<\/strong> \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043f\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0443 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043e\u0442\u0432\u0435\u0442 \u0432 JSON \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u0443.<\/p>\n<p>  <\/p>\n<h6 id=\"frontend\">\u0424\u0440\u043e\u043d\u0442\u0435\u043d\u0434<\/h6>\n<p>  <\/p>\n<p>\u0412 \u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440\u0435 \u043d\u0430\u0448\u0435\u0439 \u0438\u0433\u0440\u044b \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043a\u043d\u043e\u043f\u043a\u0438 <strong>Get random number<\/strong> \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0431\u044d\u043a\u0435\u043d\u0434\u0443 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <strong>\/number<\/strong> \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0442 \u043d\u0435\u0433\u043e \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0437\u0430\u0434\u0430\u0447\u0438 Celery. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <strong>getResult<\/strong> \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0431\u044d\u043a\u0435\u043d\u0434\u0443 \u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <strong>\/result\/&lt;task_id&gt;<\/strong>. <\/p>\n<p>  <\/p>\n<pre><code class=\"javascript\">async function getResult(task_id) {     var i = 1;     var timerId = setTimeout(async function go() {         console.log(\"Result request: \" + i);         console.log(\"Task Id: \" + task_id)         const res = await fetch(`result\/` + task_id);         const response = await res.text();          if (res.ok) {             let result = JSON.parse(response);             console.log(result)              if (result.state === 'SUCCESS') {                 let i = parseInt(result.number);                  if ($status === 1 || $history.state.squares[i]) {                     promise_number = result.number + ' - busy';                     return;                 }                  promise_number = i;                 history.push(new Command($history.state, i));                 return;             }         }          if (i &lt; 5)              setTimeout(go, 500);         i++;     }, 500); }   <\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u0437\u043c\u0435\u043d\u0438\u043b\u0438 \u0432\u044b\u0432\u043e\u0434 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0431\u044d\u043a\u0435\u043d\u0434\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"html\">{#await promise}     &lt;p&gt;...\u043f\u043e\u0434\u043e\u0436\u0434\u0438\u0442\u0435&lt;\/p&gt; {:then taskid}     &lt;p&gt;Task Id: {taskid}&lt;\/p&gt; {:catch error}     &lt;p style=\"color: red\"&gt;{error.message}&lt;\/p&gt; {\/await}  {#await promise_number}     &lt;p&gt;...\u043f\u043e\u0434\u043e\u0436\u0434\u0438\u0442\u0435&lt;\/p&gt; {:then number}     &lt;p&gt;Number: {number}&lt;\/p&gt; {:catch error}     &lt;p style=\"color: red\"&gt;{error.message}&lt;\/p&gt; {\/await}<\/code><\/pre>\n<p>  <\/p>\n<h6 id=\"domashnee-zadanie\">\u0414\u043e\u043c\u0430\u0448\u043d\u0435\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435<\/h6>\n<p>  <\/p>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0430\u0433\u0435\u043d\u0442\u0430 \u0436\u0438\u0432\u0443\u0449\u0435\u0433\u043e \u0432 <strong>celery<\/strong> \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0437\u0430\u0434\u0443\u043c\u0447\u0438\u0432\u044b\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0441\u0440\u0430\u0437\u0443 \u0432\u044b\u0434\u0430\u0432\u0430\u043b \u043e\u0442\u0432\u0435\u0442.<\/p>\n<p>  <\/p>\n<p>\u0412\u0440\u0435\u043c\u044f \u043e\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0430 \u043e\u0442 <strong>flask<\/strong>&#8216;a &#171;500 (INTERNAL SERVER ERROR)&#187;, \u044d\u0442\u043e \u0432 <strong>celery<\/strong> \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 &#171;celery.exceptions.TimeoutError: The operation timed out.&#187;. \u041f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u041f\u043e\u043a\u0430 \u043d\u0435 \u043a\u043e\u043f\u0430\u043b \u0432 \u0447\u0435\u043c \u0434\u0435\u043b\u043e, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435.<\/p>\n<p>  <\/p>\n<p>\u0412 <strong>getResult<\/strong> \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0442\u0432\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c SUCCESS, \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441. \u041c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0441 FAILURE \u0438 PENDING. \u0424\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u0430 \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0435 <strong>result<\/strong> \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438.<\/p>\n<p>  <\/p>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u0431\u0440\u043e\u043a\u0435\u0440\u0430 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 RabbitMQ \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c Redis.<\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438\u0437 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 \u0431\u0440\u043e\u043a\u0435\u0440\u044b \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439. <\/p>\n<p>  <\/p>\n<p>\u0410 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u044d\u0442\u043e \u043d\u0430 \u0431\u0430\u0437\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0441 Boost.Beast.<\/p>\n<p>  <\/p>\n<h6 id=\"repozitoriy-na-github\">\u0420\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u043d\u0430 GitHub<\/h6>\n<p>  <\/p>\n<p><a href=\"https:\/\/github.com\/nomhoi\/tic-tac-toe-part6\">https:\/\/github.com\/nomhoi\/tic-tac-toe-part6<\/a><\/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\/461531\/\"> https:\/\/habr.com\/ru\/post\/461531\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c Celery\/RabbitMQ \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0443. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0441\u043d\u043e\u0432\u044b \u0432\u043e\u0437\u044c\u043c\u0435\u043c <a href=\"https:\/\/habr.com\/ru\/post\/460621\/\">\u043f\u0440\u043e\u0435\u043a\u0442 \u0441 Flask&#8217;\u043e\u043c<\/a>. Celery \u0437\u0430\u0439\u043c\u0435\u0442\u0441\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430.<\/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-292640","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/292640","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=292640"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/292640\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=292640"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=292640"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=292640"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}