{"id":28685,"date":"2026-09-02T13:11:39","date_gmt":"2026-09-02T13:11:39","guid":{"rendered":"https:\/\/umang.pk\/2026\/09\/02\/%d8%a2%d9%be-%da%a9%d9%88-api-%da%a9%db%8c-%d8%af%d8%b1%d8%ae%d9%88%d8%a7%d8%b3%d8%aa-%da%a9%db%92-%d8%a7%d9%86%d8%af%d8%b1-%d8%a7%db%8c-%d9%85%db%8c%d9%84-%da%a9%db%8c%d9%88%da%ba-%d9%86%db%81%db%8c\/"},"modified":"2026-09-02T13:11:39","modified_gmt":"2026-09-02T13:11:39","slug":"%d8%a2%d9%be-%da%a9%d9%88-api-%da%a9%db%8c-%d8%af%d8%b1%d8%ae%d9%88%d8%a7%d8%b3%d8%aa-%da%a9%db%92-%d8%a7%d9%86%d8%af%d8%b1-%d8%a7%db%8c-%d9%85%db%8c%d9%84-%da%a9%db%8c%d9%88%da%ba-%d9%86%db%81%db%8c","status":"publish","type":"post","link":"https:\/\/umang.pk\/ur\/2026\/09\/02\/%d8%a2%d9%be-%da%a9%d9%88-api-%da%a9%db%8c-%d8%af%d8%b1%d8%ae%d9%88%d8%a7%d8%b3%d8%aa-%da%a9%db%92-%d8%a7%d9%86%d8%af%d8%b1-%d8%a7%db%8c-%d9%85%db%8c%d9%84-%da%a9%db%8c%d9%88%da%ba-%d9%86%db%81%db%8c\/","title":{"rendered":"\u0622\u067e \u06a9\u0648 API \u06a9\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u06a9\u06d2 \u0627\u0646\u062f\u0631 \u0627\u06cc \u0645\u06cc\u0644 \u06a9\u06cc\u0648\u06ba \u0646\u06c1\u06cc\u06ba \u0628\u06be\u06cc\u062c\u0646\u0627 \u0686\u0627\u06c1\u0626\u06d2\u06d4"},"content":{"rendered":"\n<div id=\"\">\n<p>\u062a\u0631\u0642\u06cc \u06a9\u06d2 \u0645\u0631\u062d\u0644\u06d2 \u067e\u0631\u060c \u0633\u0627\u0626\u0646 \u0627\u067e \u0627\u062e\u062a\u062a\u0627\u0645\u06cc \u0646\u0642\u0637\u06c1 \u0679\u06be\u06cc\u06a9 \u0646\u0638\u0631 \u0622\u062a\u0627 \u06c1\u06d2\u06d4 \u0635\u0627\u0631\u0641 \u0631\u062c\u0633\u0679\u0631 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u060c \u0642\u0637\u0627\u0631 \u06a9\u0648 \u0645\u062d\u0641\u0648\u0638 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u060c \u0627\u067e\u0646\u06d2 \u0627\u06cc \u0645\u06cc\u0644 \u0641\u0631\u0627\u06c1\u0645 \u06a9\u0646\u0646\u062f\u06c1 \u06a9\u0648 \u06a9\u0627\u0644 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u060c \u0627\u0648\u0631 \u0648\u0627\u067e\u0633 \u0622\u062a\u0627 \u06c1\u06d2\u06d4 <code>201 Created<\/code>. \u06c1\u0631 \u0627\u06cc\u06a9 \u06a9\u0648 \u062e\u0648\u0634 \u0622\u0645\u062f\u06cc\u062f \u0627\u06cc \u0645\u06cc\u0644 \u0645\u0648\u0635\u0648\u0644 \u06c1\u0648\u062a\u0627 \u06c1\u06d2\u06d4 \u0622\u067e \u0627\u0633\u06d2 \u0628\u06be\u06cc\u062c \u062f\u06cc\u06ba\u06d4<\/p>\n<p>\u067e\u06be\u0631 \u067e\u0631\u0648\u0688\u06a9\u0634\u0646 \u0679\u0631\u06cc\u0641\u06a9 \u0622\u062a\u0627 \u06c1\u06d2\u06d4<\/p>\n<p>\u0627\u06cc \u0645\u06cc\u0644 API 200 \u0645\u0644\u06cc \u0633\u06cc\u06a9\u0646\u0688 \u06a9\u06d2 \u0628\u062c\u0627\u0626\u06d2 2 \u0633\u06cc\u06a9\u0646\u0688 \u0644\u06cc\u062a\u0627 \u06c1\u06d2\u06d4 \u06a9\u0626\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u0648\u06ba \u06a9\u0627 \u0648\u0642\u062a \u062e\u062a\u0645 \u06c1\u0648 \u06af\u06cc\u0627\u06d4 \u0641\u0631\u0627\u06c1\u0645 \u06a9\u0646\u0646\u062f\u06c1 \u06a9\u06cc \u0628\u0646\u062f\u0634 \u06a9\u06d2 \u062f\u0648\u0631\u0627\u0646\u060c \u062a\u0645\u0627\u0645 \u0633\u0628\u0633\u06a9\u0631\u067e\u0634\u0646\u0632 \u0648\u0627\u067e\u0633 \u0622\u0646\u0627 \u0634\u0631\u0648\u0639 \u06c1\u0648 \u062c\u0627\u0626\u06cc\u06ba \u06af\u06cc\u06d4 <code>500<\/code>. \u0633\u067e\u0648\u0631\u0679 \u067e\u0648\u0686\u06be\u062a\u0627 \u06c1\u06d2 \u06a9\u06c1 \u0635\u0627\u0631\u0641 \u0627\u06a9\u0627\u0624\u0646\u0679 \u06a9\u06cc\u0648\u06ba \u0628\u0646\u0627 \u0633\u06a9\u062a\u0627 \u06c1\u06d2 \u0644\u06cc\u06a9\u0646 \u062a\u0635\u062f\u06cc\u0642\u06cc \u0644\u0646\u06a9 \u062d\u0627\u0635\u0644 \u0646\u06c1\u06cc\u06ba \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4<\/p>\n<p>\u0628\u06af \u0627\u06cc \u0645\u06cc\u0644 \u0679\u06cc\u0645\u067e\u0644\u06cc\u0679 \u0646\u06c1\u06cc\u06ba \u06c1\u06d2\u06d4 \u0628\u06af \u0648\u06c1 \u062c\u06af\u06c1 \u06c1\u06d2 \u062c\u06c1\u0627\u06ba \u0645\u06cc\u06ba \u0646\u06d2 \u0627\u06cc \u0645\u06cc\u0644 \u0628\u06be\u06cc\u062c\u0646\u06d2 \u06a9\u0627 \u0641\u06cc\u0635\u0644\u06c1 \u06a9\u06cc\u0627\u06d4<\/p>\n<p>\u0627\u0633 \u0622\u0631\u0679\u06cc\u06a9\u0644 \u0645\u06cc\u06ba\u060c \u0622\u067e \u06cc\u06c1 \u0633\u06cc\u06a9\u06be\u06cc\u06ba \u06af\u06d2 \u06a9\u06c1 HTTP \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u06a9\u06d2 \u0631\u0627\u0633\u062a\u06d2 \u0645\u06cc\u06ba \u0627\u06cc \u0645\u06cc\u0644\u0632 \u0628\u06be\u06cc\u062c\u0646\u0627 \u0627\u06cc\u06a9 \u067e\u0631\u0648\u0688\u06a9\u0634\u0646 \u0679\u0631\u06cc\u067e \u06a9\u06cc\u0648\u06ba \u06c1\u06d2\u060c \u062c\u0628 \u0622\u067e \u0627\u0633\u06a9\u06cc\u0644 \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba \u062a\u0648 \u06a9\u06cc\u0627 \u063a\u0644\u0637 \u06c1\u0648\u062a\u0627 \u06c1\u06d2\u060c \u0627\u0648\u0631 \u0627\u067e\u0646\u06d2 API \u06a9\u0648 \u062a\u06cc\u0632 \u0627\u0648\u0631 \u0642\u0627\u0628\u0644 \u0627\u0639\u062a\u0645\u0627\u062f \u0631\u06a9\u06be\u0646\u06d2 \u06a9\u06d2 \u0644\u06cc\u06d2 \u0627\u06cc \u0645\u06cc\u0644\u0632 (\u0627\u0648\u0631 \u062f\u06cc\u06af\u0631 \u0636\u0645\u0646\u06cc \u0627\u062b\u0631\u0627\u062a) \u06a9\u0648 \u0628\u06cc\u06a9 \u06af\u0631\u0627\u0624\u0646\u0688 \u0679\u0627\u0633\u06a9 \u06a9\u06cc\u0648 \u0645\u06cc\u06ba \u06a9\u06cc\u0633\u06d2 \u0645\u0646\u062a\u0642\u0644 \u06a9\u06cc\u0627 \u062c\u0627\u0626\u06d2\u06d4<\/p>\n<h2 id=\"heading-prerequisites\">\u0634\u0631\u0637\u06cc\u06ba<\/h2>\n<p>\u0627\u06af\u0631 \u0622\u067e \u0645\u0646\u062f\u0631\u062c\u06c1 \u0630\u06cc\u0644 \u062c\u0627\u0646\u062a\u06d2 \u06c1\u06cc\u06ba\u060c \u062a\u0648 \u0622\u067e \u06a9\u0648 \u0627\u0633 \u0645\u0636\u0645\u0648\u0646 \u0645\u06cc\u06ba \u0645\u0632\u06cc\u062f \u0645\u0639\u0644\u0648\u0645\u0627\u062a \u0645\u0644\u06cc\u06ba \u06af\u06cc:<\/p>\n<ul>\n<li>\n<p>REST APIs \u06a9\u06cc\u0633\u06d2 \u06a9\u0627\u0645 \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba (\u062f\u0631\u062e\u0648\u0627\u0633\u062a\u06cc\u06ba\u060c \u062c\u0648\u0627\u0628\u0627\u062a\u060c \u0627\u0633\u0679\u06cc\u0679\u0633 \u06a9\u0648\u0688\u0632)<\/p>\n<\/li>\n<li>\n<p>\u0645\u0642\u0627\u0645\u06cc Node.js \u06cc\u0627 \u06a9\u0648\u0626\u06cc \u0628\u06be\u06cc \u0628\u06cc\u06a9 \u0627\u06cc\u0646\u0688 \u0632\u0628\u0627\u0646 \u062c\u0648 \u0627\u06cc \u0645\u06cc\u0644 API \u06a9\u0648 \u06a9\u0627\u0644 \u06a9\u0631 \u0633\u06a9\u062a\u06cc \u06c1\u06d2\u06d4<\/p>\n<\/li>\n<li>\n<p>\u0627\u06cc\u06a9 \u0627\u0639\u0644\u06cc \u0633\u0637\u062d\u06cc \u067e\u0633 \u0645\u0646\u0638\u0631 \u06a9\u0627 \u06a9\u0627\u0645 \u06cc\u0627 \u0642\u0637\u0627\u0631 \u06a9\u06cc\u0627 \u06c1\u06d2\u061f<\/p>\n<\/li>\n<\/ul>\n<p>BullMQ\u060c Redis\u060c \u06cc\u0627 \u06a9\u0633\u06cc \u0645\u062e\u0635\u0648\u0635 \u0627\u06cc \u0645\u06cc\u0644 \u0641\u0631\u0627\u06c1\u0645 \u06a9\u0646\u0646\u062f\u06c1 \u06a9\u06d2 \u0633\u0627\u062a\u06be \u06a9\u0633\u06cc \u067e\u06cc\u0634\u06af\u06cc \u062a\u062c\u0631\u0628\u06d2 \u06a9\u06cc \u0636\u0631\u0648\u0631\u062a \u0646\u06c1\u06cc\u06ba \u06c1\u06d2\u06d4<\/p>\n<h2 id=\"heading-table-of-contents\">\u0627\u0646\u0688\u06cc\u06a9\u0633<\/h2>\n<h2 id=\"heading-1-what-inside-the-request-really-means\">1. &quot;\u062f\u0631\u062e\u0648\u0627\u0633\u062a \u06a9\u06d2 \u0627\u0646\u062f\u0631&#8221; \u06a9\u0627 \u0627\u0635\u0644 \u0645\u0637\u0644\u0628 \u06a9\u06cc\u0627 \u06c1\u06d2\u06d4<\/h2>\n<p>\u062c\u0628 \u06a9\u0644\u0627\u0626\u0646\u0679 API \u062a\u06a9 \u067e\u06c1\u0646\u0686 \u062c\u0627\u062a\u0627 \u06c1\u06d2\u060c \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u06a9\u0627 \u0631\u0627\u0633\u062a\u06c1 \u0648\u06c1 \u0633\u0628 \u06a9\u0686\u06be \u06c1\u0648\u062a\u0627 \u06c1\u06d2 \u062c\u0633\u06d2 HTTP \u062c\u0648\u0627\u0628 \u0628\u06be\u06cc\u062c\u0646\u06d2 \u0633\u06d2 \u067e\u06c1\u0644\u06d2 \u0645\u06a9\u0645\u0644 \u06a9\u0631\u0646\u06d2 \u06a9\u06cc \u0636\u0631\u0648\u0631\u062a \u06c1\u0648\u062a\u06cc \u06c1\u06d2\u06d4<\/p>\n<p>\u0627\u0633 \u0645\u06cc\u06ba \u0639\u0627\u0645 \u0637\u0648\u0631 \u067e\u0631 \u0634\u0627\u0645\u0644 \u06c1\u06cc\u06ba:<\/p>\n<ul>\n<li>\n<p>\u0627\u0646 \u067e\u0679 \u06a9\u06cc \u062a\u0648\u062b\u06cc\u0642 \u06c1\u0648 \u0631\u06c1\u06cc \u06c1\u06d2\u06d4<\/p>\n<\/li>\n<li>\n<p>\u062a\u0635\u062f\u06cc\u0642 \u06a9\u06cc \u062a\u0648\u062b\u06cc\u0642 \u06a9\u06cc \u062c\u0627 \u0631\u06c1\u06cc \u06c1\u06d2\u06d4<\/p>\n<\/li>\n<li>\n<p>\u0688\u06cc\u0679\u0627 \u0628\u06cc\u0633 \u067e\u0631 \u0644\u06a9\u06be\u06cc\u06ba<\/p>\n<\/li>\n<li>\n<p>JSON \u0648\u0627\u067e\u0633 \u06a9\u0631\u06cc\u06ba\u06d4<\/p>\n<\/li>\n<\/ul>\n<p>\u0645\u0646\u062f\u0631\u062c\u06c1 \u0630\u06cc\u0644 \u06a9\u0648 \u0634\u0627\u0630 \u0648 \u0646\u0627\u062f\u0631 \u06c1\u06cc \u0634\u0627\u0645\u0644 \u06a9\u06cc\u0627 \u062c\u0627\u0646\u0627 \u0686\u0627\u06c1\u0626\u06d2:<\/p>\n<ul>\n<li>\n<p>SMTP \u0633\u0631\u0648\u0631 \u06a9\u0648 \u06a9\u0627\u0644 \u06a9\u0631\u06cc\u06ba\u06d4<\/p>\n<\/li>\n<li>\n<p>\u062f\u0648\u0628\u0627\u0631\u06c1 \u0628\u06be\u06cc\u062c\u0646\u06d2\u060c SendGrid\u060c SES\u060c Mailgun \u06cc\u0627 \u067e\u0648\u0633\u0679 \u0645\u0627\u0631\u06a9 \u06a9\u0627 \u0627\u0646\u062a\u0638\u0627\u0631 \u06a9\u0631 \u0631\u06c1\u06d2 \u06c1\u06cc\u06ba\u06d4<\/p>\n<\/li>\n<li>\n<p>\u0628\u0691\u06d2 HTML \u0679\u06cc\u0645\u067e\u0644\u06cc\u0679\u0633 \u067e\u06cc\u0634 \u06a9\u0631\u06cc\u06ba \u0627\u0648\u0631 \u0645\u0646\u0633\u0644\u06a9\u0627\u062a \u0627\u067e \u0644\u0648\u0688 \u06a9\u0631\u06cc\u06ba\u06d4<\/p>\n<\/li>\n<li>\n<p>\u063a\u06cc\u0631 \u0645\u0633\u062a\u062d\u06a9\u0645 \u062a\u06be\u0631\u0688 \u067e\u0627\u0631\u0679\u06cc \u0646\u06cc\u0679 \u0648\u0631\u06a9 \u06a9\u0627\u0644\u0632 \u06a9\u06cc \u062f\u0648\u0628\u0627\u0631\u06c1 \u06a9\u0648\u0634\u0634 \u06a9\u06cc \u062c\u0627 \u0631\u06c1\u06cc \u06c1\u06d2\u06d4<\/p>\n<\/li>\n<\/ul>\n<p>\u0622\u067e \u06a9\u0627 \u0627\u06cc \u0645\u06cc\u0644 \u0641\u0631\u0627\u06c1\u0645 \u06a9\u0646\u0646\u062f\u06c1 \u0627\u06cc\u06a9 \u0628\u06cc\u0631\u0648\u0646\u06cc \u0646\u0638\u0627\u0645 \u06c1\u06d2\u06d4 \u0627\u0633 \u06a9\u06cc \u0627\u067e\u0646\u06cc \u062a\u0627\u062e\u06cc\u0631\u060c \u0631\u0641\u062a\u0627\u0631 \u06a9\u06cc \u062d\u062f\u06cc\u06ba \u0627\u0648\u0631 \u0628\u0646\u062f\u0634\u06cc\u06ba \u06c1\u06cc\u06ba\u06d4 \u0627\u06af\u0631 API \u0627\u0646 \u06a9\u0627 \u0627\u0646\u062a\u0638\u0627\u0631 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u060c \u062a\u0648 \u0627\u0646 \u06a9\u0627 \u0645\u0633\u0626\u0644\u06c1 \u0635\u0627\u0631\u0641 \u06a9\u0627 \u0645\u0633\u0626\u0644\u06c1 \u0628\u0646 \u062c\u0627\u062a\u0627 \u06c1\u06d2\u06d4<\/p>\n<pre><code class=\"language-text\">Bad path (synchronous):\n\nClient \u2500\u2500&#x25b6; API \u2500\u2500&#x25b6; Database \u2500\u2500&#x25b6; Email provider \u2500\u2500&#x25b6; Client\n                         \u25b2\n                         \u2514\u2500\u2500 user waits for all of this\n<\/code><\/pre>\n<h2 id=\"heading-2-the-tempting-code-that-causes-the-problem\">2. \u0645\u0648\u06c1\u06a9 \u06a9\u0648\u0688 \u062c\u0648 \u0645\u0633\u0627\u0626\u0644 \u06a9\u0627 \u0633\u0628\u0628 \u0628\u0646\u062a\u0627 \u06c1\u06d2\u06d4<\/h2>\n<p>\u06cc\u06c1 \u0648\u06c1 \u0646\u0645\u0648\u0646\u06c1 \u06c1\u06d2 \u062c\u0633 \u0633\u06d2 \u0632\u06cc\u0627\u062f\u06c1 \u062a\u0631 \u0679\u06cc\u0645\u06cc\u06ba \u0634\u0631\u0648\u0639 \u06a9\u0631\u062a\u06cc \u06c1\u06cc\u06ba: \u06cc\u06c1 \u0648\u0627\u0636\u062d\u060c \u0645\u062e\u062a\u0635\u0631 \u0627\u0648\u0631 \u0645\u06cc\u0631\u06d2 \u0644\u06cc\u067e \u0679\u0627\u067e \u067e\u0631 \u06a9\u0627\u0645 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4<\/p>\n<pre><code class=\"language-typescript\">app.post('\/signup', async (c) => {\n  const body = await c.req.json();\n\n  const user = await db.users.create({\n    email: body.email,\n    passwordHash: await hash(body.password),\n  });\n\n  \/\/ This is the trap.\n  await emailClient.send({\n    to: user.email,\n    subject: 'Confirm your account',\n    html: renderConfirmEmail(user),\n  });\n\n  return c.json({ id: user.id }, 201);\n});\n<\/code><\/pre>\n<p>\u0622\u067e \u06a9\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0627\u0633 \u0648\u0642\u062a \u062a\u06a9 \u0645\u06a9\u0645\u0644 \u0646\u06c1\u06cc\u06ba \u06c1\u0648 \u0633\u06a9\u062a\u06cc \u062c\u0628 \u062a\u06a9 \u06a9\u06c1 \u0622\u067e \u06a9\u0627 \u0627\u06cc \u0645\u06cc\u0644 \u0641\u0631\u0627\u06c1\u0645 \u06a9\u0646\u0646\u062f\u06c1 \u062c\u0648\u0627\u0628 \u0646\u06c1\u06cc\u06ba \u062f\u06cc\u062a\u0627\u06d4 \u0627\u06af\u0631 \u06a9\u0627\u0644 \u0633\u0633\u062a \u06c1\u06d2 \u062a\u0648 \u062c\u0648\u0627\u0628 \u0628\u06be\u06cc \u0633\u0633\u062a \u06c1\u0648\u06af\u0627\u06d4 \u062c\u0628 \u0648\u06c1 \u06a9\u0627\u0644 \u06c1\u0648\u062a\u06cc \u06c1\u06d2\u060c \u062a\u0648 \u0633\u0627\u0626\u0646 \u0627\u067e \u06cc\u0627 \u062a\u0648 \u0646\u0627\u06a9\u0627\u0645 \u06c1\u0648 \u062c\u0627\u0626\u06d2 \u06af\u0627 \u06cc\u0627 \u06c1\u0645\u06cc\u06ba \u0627\u06cc\u06a9 \u063a\u0644\u0637\u06cc \u0646\u0638\u0631 \u0622\u0626\u06d2 \u06af\u06cc \u0627\u0648\u0631 \u062e\u0648\u062f \u0628\u062e\u0648\u062f \u0627\u06cc \u0645\u06cc\u0644 \u06a9\u0648 \u0686\u06be\u0648\u0691 \u062f\u06cc\u06ba \u06af\u06d2\u06d4<\/p>\n<p>\u06a9\u0648\u0626\u06cc \u0628\u06be\u06cc \u0622\u067e\u0634\u0646 \u0627\u0686\u06be\u0627 \u0646\u06c1\u06cc\u06ba \u06c1\u06d2\u06d4<\/p>\n<h2 id=\"heading-3-why-this-breaks-in-production\">3. \u067e\u06cc\u062f\u0627\u0648\u0627\u0631 \u06a9\u06cc\u0648\u06ba \u0631\u06a9 \u062c\u0627\u062a\u06cc \u06c1\u06d2\u061f<\/h2>\n<h3 id=\"heading-your-response-time-becomes-someone-elses-sla\">\u0622\u067e \u06a9\u06d2 \u062c\u0648\u0627\u0628 \u06a9\u0627 \u0648\u0642\u062a \u06a9\u0633\u06cc \u0627\u0648\u0631 \u06a9\u0627 SLA \u0628\u0646 \u062c\u0627\u062a\u0627 \u06c1\u06d2\u06d4<\/h3>\n<p>\u0627\u06cc\u06a9 \u0635\u062d\u062a \u0645\u0646\u062f \u0633\u0628\u0633\u06a9\u0631\u067e\u0634\u0646 \u0627\u06cc\u0646\u0688 \u067e\u0648\u0627\u0626\u0646\u0679 \u06a9\u0648 \u0627\u06a9\u062b\u0631 \u062f\u0633\u06cc\u0648\u06ba \u06cc\u0627 \u0633\u06cc\u0646\u06a9\u0691\u0648\u06ba \u0645\u0644\u06cc \u0633\u06cc\u06a9\u0646\u0688 \u06a9\u06d2 \u0627\u0646\u062f\u0631 \u062c\u0648\u0627\u0628 \u062f\u06cc\u0646\u06d2 \u06a9\u06cc \u0636\u0631\u0648\u0631\u062a \u06c1\u0648\u062a\u06cc \u06c1\u06d2\u06d4 \u0627\u06cc \u0645\u06cc\u0644 APIs \u06a9\u0648 \u0639\u0627\u0645 \u0637\u0648\u0631 \u067e\u0631 \u0627\u0633 \u0633\u06d2 \u0632\u06cc\u0627\u062f\u06c1 \u0648\u0642\u062a \u0644\u06af\u062a\u0627 \u06c1\u06d2\u06d4 \u0627\u06af\u0631 \u0628\u0648\u062c\u06be \u06c1\u06d2 \u062a\u0648 \u0627\u0633 \u0645\u06cc\u06ba \u0632\u06cc\u0627\u062f\u06c1 \u0648\u0642\u062a \u0644\u06af\u06d2 \u06af\u0627\u06d4<\/p>\n<p>p95 \u0644\u06cc\u0679\u0646\u0633\u06cc \u0627\u0628 \u06a9\u0648\u0688 \u06a9\u06cc \u0645\u0644\u06a9\u06cc\u062a \u0646\u06c1\u06cc\u06ba \u06c1\u06d2\u06d4 \u0631\u0627\u0633\u062a\u06d2 \u067e\u0631 \u0633\u0628 \u0633\u06d2 \u0633\u0633\u062a \u062a\u06be\u0631\u0688 \u067e\u0627\u0631\u0679\u06cc \u06a9\u0627\u0644 \u06a9\u06cc \u0645\u0644\u06a9\u06cc\u062a\u06d4<\/p>\n<h3 id=\"heading-failures-create-ugly-tradeoffs\">\u0646\u0627\u06a9\u0627\u0645\u06cc \u0628\u062f\u0635\u0648\u0631\u062a \u062a\u062c\u0627\u0631\u062a \u067e\u06cc\u062f\u0627 \u06a9\u0631\u062a\u06cc \u06c1\u06d2\u06d4<\/h3>\n<p>\u0627\u06af\u0631 <code>send()<\/code> \u062c\u0628 \u0622\u067e \u067e\u06be\u06cc\u0646\u06a9\u062a\u06d2 \u06c1\u06cc\u06ba\u060c \u062a\u0648 \u0622\u067e \u06a9\u06d2 \u067e\u0627\u0633 \u062f\u0648 \u0628\u0631\u06d2 \u0627\u0646\u062a\u062e\u0627\u0628 \u06c1\u0648\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4<\/p>\n<ol>\n<li>\n<p>\u067e\u0648\u0631\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0646\u0627\u06a9\u0627\u0645 \u06c1\u0648\u062c\u0627\u062a\u06cc \u06c1\u06d2: \u0635\u0627\u0631\u0641 \u06a9\u0648 \u063a\u0644\u0637\u06cc \u0646\u0638\u0631 \u0622\u062a\u06cc \u06c1\u06d2 \u0686\u0627\u06c1\u06d2 \u0627\u06a9\u0627\u0624\u0646\u0679 \u067e\u06c1\u0644\u06d2 \u0633\u06d2 \u0645\u0648\u062c\u0648\u062f \u06c1\u0648\u06d4<\/p>\n<\/li>\n<li>\n<p>\u063a\u0644\u0637\u06cc \u06a9\u0648 \u0646\u06af\u0644 \u0644\u06cc\u06ba: \u0635\u0627\u0631\u0641 \u0628\u0646\u0627\u06cc\u0627 \u06af\u06cc\u0627 \u0644\u06cc\u06a9\u0646 \u0627\u06cc \u0645\u06cc\u0644 \u0645\u0648\u0635\u0648\u0644 \u0646\u06c1\u06cc\u06ba \u06c1\u0648\u0627\u06d4<\/p>\n<\/li>\n<\/ol>\n<p>\u062f\u0648\u0633\u0631\u06cc \u0635\u0648\u0631\u062a \u062e\u0627\u0635 \u0637\u0648\u0631 \u067e\u0631 \u062a\u0635\u062f\u06cc\u0642 \u06cc\u0627 \u067e\u0627\u0633 \u0648\u0631\u0688 \u062f\u0648\u0628\u0627\u0631\u06c1 \u062a\u0631\u062a\u06cc\u0628 \u062f\u06cc\u0646\u06d2 \u06a9\u06d2 \u062f\u0648\u0631\u0627\u0646 \u062a\u06a9\u0644\u06cc\u0641 \u062f\u06c1 \u06c1\u0648\u062a\u06cc \u06c1\u06d2\u06d4 \u0688\u06cc\u0679\u0627 \u0628\u06cc\u0633 \u06a9\u06c1\u062a\u0627 \u06c1\u06d2 \u06a9\u0627\u0645\u06cc\u0627\u0628\u06cc\u060c \u0644\u06cc\u06a9\u0646 \u0645\u06cc\u0631\u0627 \u0627\u0646 \u0628\u0627\u06a9\u0633 \u06a9\u0686\u06be \u0646\u06c1\u06cc\u06ba \u062f\u06a9\u06be\u0627\u062a\u0627\u06d4<\/p>\n<h3 id=\"heading-timeouts-cascade\">\u0679\u0627\u0626\u0645 \u0622\u0624\u0679 \u06a9\u0627\u0633\u06a9\u06cc\u0688\u0646\u06af<\/h3>\n<p>API \u06af\u06cc\u0679 \u0648\u06cc\u0632\u060c \u0644\u0648\u0688 \u0628\u06cc\u0644\u0646\u0633\u0631\u0632\u060c \u0627\u0648\u0631 \u0628\u0631\u0627\u0624\u0632\u0631\u0632 \u0633\u0628\u06be\u06cc \u06a9\u0627 \u0679\u0627\u0626\u0645 \u0622\u0624\u0679 \u06c1\u0648\u062a\u0627 \u06c1\u06d2\u06d4 \u0633\u0633\u062a \u0627\u06cc \u0645\u06cc\u0644 \u06a9\u0627\u0644\u0632 \u0627\u06cc\u06a9 \u06a9\u0627\u0645\u06cc\u0627\u0628 \u06a9\u0627\u0631\u0648\u0628\u0627\u0631\u06cc \u06a9\u0648\u0634\u0634 \u06a9\u0648 \u06a9\u0644\u0627\u0626\u0646\u0679 \u06a9\u06cc \u0637\u0631\u0641 \u0633\u06d2 \u0646\u0627\u06a9\u0627\u0645\u06cc \u0645\u06cc\u06ba \u0628\u062f\u0644 \u0633\u06a9\u062a\u06cc \u06c1\u06cc\u06ba\u06d4 \u0635\u0627\u0631\u0641 \u062f\u0648\u0628\u0627\u0631\u06c1 \u06a9\u0648\u0634\u0634 \u06a9\u0631\u06d2 \u06af\u0627\u06d4 \u0627\u0628 \u0622\u067e \u0688\u067e\u0644\u06cc\u06a9\u06cc\u0679 \u0635\u0627\u0631\u0641\u06cc\u0646 \u0628\u0646\u0627 \u0633\u06a9\u062a\u06d2 \u06c1\u06cc\u06ba \u06cc\u0627 \u0688\u067e\u0644\u06cc\u06a9\u06cc\u0679 \u0627\u06cc \u0645\u06cc\u0644 \u0628\u06be\u06cc\u062c \u0633\u06a9\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4<\/p>\n<h3 id=\"heading-rate-limits-punish-traffic-spikes\">\u0631\u0641\u062a\u0627\u0631 \u06a9\u06cc \u062d\u062f \u06a9\u06d2 \u0633\u0627\u062a\u06be \u0679\u0631\u06cc\u0641\u06a9 \u06a9\u06d2 \u0627\u0636\u0627\u0641\u06d2 \u06a9\u0648 \u0633\u0632\u0627 \u062f\u06cc\u06ba\u06d4<\/h3>\n<p>\u0627\u06cc \u0645\u06cc\u0644 \u0641\u0631\u0627\u06c1\u0645 \u06a9\u0631\u0646\u06d2 \u0648\u0627\u0644\u06d2 \u0631\u0641\u062a\u0627\u0631 \u06a9\u0648 \u0645\u062d\u062f\u0648\u062f \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4 \u067e\u0631\u0648\u0688\u06a9\u0679 \u0644\u0627\u0646\u0686\u060c \u0688\u0627\u0626\u062c\u0633\u0679\u060c \u067e\u0627\u0633 \u0648\u0631\u0688 \u0631\u06cc \u0633\u06cc\u0679 \u0633\u0631\u062c\u0632 \u0648\u063a\u06cc\u0631\u06c1 \u0633\u0628\u06be\u06cc \u0627\u0646 \u062d\u062f\u0648\u062f \u06a9\u0648 \u0645\u0627\u0631 \u0633\u06a9\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4 \u062c\u0628 \u06a9\u0633\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u06a9\u06d2 \u0627\u0646\u062f\u0631 \u0645\u0646\u062a\u0642\u0644\u06cc \u06c1\u0648\u062a\u06cc \u06c1\u06d2\u060c \u062a\u0648 \u0634\u0631\u062d \u06a9\u0648 \u0645\u062d\u062f\u0648\u062f \u06a9\u0631\u0646\u06d2 \u0648\u0627\u0644\u06cc \u063a\u0644\u0637\u06cc \u0635\u0627\u0631\u0641 \u06a9\u0648 \u062f\u06a9\u06be\u0627\u0626\u06cc \u062c\u0627\u0646\u06d2 \u0648\u0627\u0644\u06cc API \u06a9\u06cc \u062e\u0631\u0627\u0628\u06cc \u0628\u0646 \u062c\u0627\u062a\u06cc \u06c1\u06d2\u06d4<\/p>\n<h3 id=\"heading-you-cant-retry-cleanly\">\u0635\u0627\u0641 \u0637\u0648\u0631 \u067e\u0631 \u062f\u0648\u0628\u0627\u0631\u06c1 \u06a9\u0648\u0634\u0634 \u0646\u06c1\u06cc\u06ba \u06a9\u0631 \u0633\u06a9\u062a\u06d2<\/h3>\n<p>\u067e\u0633 \u0645\u0646\u0638\u0631 \u06a9\u06d2 \u06a9\u0627\u0645\u0648\u06ba \u06a9\u0648 \u0628\u06cc\u06a9 \u0622\u0641 \u06a9\u06d2 \u0633\u0627\u062a\u06be \u062f\u0648\u0628\u0627\u0631\u06c1 \u0622\u0632\u0645\u0627\u06cc\u0627 \u062c\u0627 \u0633\u06a9\u062a\u0627 \u06c1\u06d2\u06d4 HTTP \u062f\u0631\u062e\u0648\u0627\u0633\u062a\u06cc\u06ba \u0646\u06c1\u06cc\u06ba \u06a9\u06cc \u062c\u0627 \u0633\u06a9\u062a\u06cc \u06c1\u06cc\u06ba\u06d4 \u062c\u0648\u0627\u0628 \u0648\u0627\u067e\u0633 \u06a9\u0631\u0646\u06d2 \u0633\u06d2 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u062e\u062a\u0645 \u06c1\u0648\u062c\u0627\u062a\u06cc \u06c1\u06d2\u06d4 \u0627\u06af\u0631 \u0622\u067e \u06a9\u0627 \u0627\u06cc \u0645\u06cc\u0644 \u0646\u0627\u06a9\u0627\u0645 \u06c1\u0648\u062c\u0627\u062a\u0627 \u06c1\u06d2 \u0627\u0648\u0631 \u0622\u067e \u0646\u06d2 \u067e\u06c1\u0644\u06d2 \u06c1\u06cc \u06a9\u0644\u0627\u0626\u0646\u0679 \u06a9\u0648 \u0627\u0633 \u06a9\u06cc &quot;\u06a9\u0627\u0645\u06cc\u0627\u0628\u06cc&#8221; \u06a9\u06d2 \u0628\u0627\u0631\u06d2 \u0645\u06cc\u06ba \u0645\u0637\u0644\u0639 \u06a9\u0631 \u062f\u06cc\u0627 \u06c1\u06d2\u060c \u062a\u0648 \u0622\u067e \u06a9\u0648 \u0627\u0633 \u0633\u06d2 \u0628\u0627\u0632\u06cc\u0627\u0641\u062a \u06a9\u0631\u0646\u06d2 \u06a9\u06d2 \u0644\u06cc\u06d2 \u0627\u06cc\u06a9 \u0627\u0648\u0631 \u0633\u0633\u0679\u0645 \u06a9\u06cc \u0636\u0631\u0648\u0631\u062a \u06c1\u0648\u06af\u06cc\u06d4 \u0648\u06c1 \u0646\u0638\u0627\u0645 \u0627\u06cc\u06a9 \u0642\u0637\u0627\u0631 \u06c1\u06d2\u06d4<\/p>\n<pre><code class=\"language-text\">What the user experiences during a provider slowdown:\n\nSignup click\n   \u2502\n   \u25bc\nAPI waits on email provider .............. 2s ... 5s ... timeout\n   \u2502\n   \u25bc\n\"Something went wrong\"\n   \u2502\n   \u25bc\nUser clicks again \u2192 duplicate attempts, confused support tickets\n<\/code><\/pre>\n<h2 id=\"heading-4-the-rule-your-api-should-enqueue-work-not-do-it\">4. \u0642\u0627\u0639\u062f\u06c1: APIs \u06a9\u0648 \u0642\u0637\u0627\u0631 \u0645\u06cc\u06ba \u06c1\u0648\u0646\u0627 \u0686\u0627\u06c1\u06cc\u06d2\u060c \u0622\u067e\u0631\u06cc\u0634\u0646\u0632 \u0646\u06c1\u06cc\u06ba \u06a9\u0631\u0646\u0627 \u0686\u0627\u06c1\u06cc\u06d2\u06d4<\/h2>\n<p>\u0627\u06cc \u0645\u06cc\u0644 \u06a9\u0648 \u0627\u06cc\u06a9 \u063a\u06cc\u0631 \u0645\u0637\u0627\u0628\u0642\u062a \u067e\u0630\u06cc\u0631 \u0622\u067e\u0631\u06cc\u0634\u0646 \u06a9\u06d2 \u0637\u0648\u0631 \u067e\u0631 \u0633\u0645\u062c\u06be\u06cc\u06ba \u062c\u0648 \u06c1\u0648\u0646\u0627 \u0636\u0631\u0648\u0631\u06cc \u06c1\u06d2\u06d4 <em>\u06a9\u06cc\u0648\u0646\u06a9\u06c1<\/em> \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u0646\u06c1\u06cc\u06ba <em>\u0627\u0646\u062f\u0631<\/em> \u062f\u0631\u062e\u0648\u0627\u0633\u062a<\/p>\n<p>\u062f\u0631\u062e\u0648\u0627\u0633\u062a \u06a9\u0627 \u0631\u0627\u0633\u062a\u06c1 \u06c1\u0648\u0646\u0627 \u0686\u0627\u06c1\u0626\u06d2:<\/p>\n<ol>\n<li>\n<p>\u0627\u0646 \u067e\u0679 \u06a9\u06cc \u062a\u0648\u062b\u06cc\u0642 \u06a9\u0631\u06cc\u06ba<\/p>\n<\/li>\n<li>\n<p>\u06a9\u0627\u0631\u0648\u0628\u0627\u0631\u06cc \u062a\u0628\u062f\u06cc\u0644\u06cc\u0648\u06ba \u06a9\u0627 \u0627\u0631\u062a\u06a9\u0627\u0628<\/p>\n<\/li>\n<li>\n<p>\u0627\u06cc \u0645\u06cc\u0644 \u06a9\u06cc \u0648\u0636\u0627\u062d\u062a \u06a9\u0631\u0646\u06d2 \u06a9\u06d2 \u0644\u06cc\u06d2 \u0642\u0637\u0627\u0631 \u0645\u06cc\u06ba \u0627\u06cc\u06a9 \u06a9\u0627\u0645 \u0634\u0627\u0645\u0644 \u06a9\u0631\u06cc\u06ba\u06d4<\/p>\n<\/li>\n<li>\n<p>\u062c\u0644\u062f\u06cc \u0648\u0627\u067e\u0633 \u0622\u062c\u0627\u0624<\/p>\n<\/li>\n<\/ol>\n<p>\u062f\u0648\u0633\u0631\u06d2 \u0645\u0642\u0627\u0645\u0627\u062a \u067e\u0631 \u06a9\u0627\u0645 \u06a9\u0631\u0646\u06d2 \u0648\u0627\u0644\u0648\u06ba \u06a9\u0648:<\/p>\n<ol>\n<li>\n<p>\u0627\u06cc\u06a9 \u06a9\u0627\u0645 \u06a9\u0627 \u0627\u0646\u062a\u062e\u0627\u0628 \u06a9\u0631\u06cc\u06ba<\/p>\n<\/li>\n<li>\n<p>\u0631\u06cc\u0646\u0688\u0631 \u0679\u06cc\u0645\u067e\u0644\u06cc\u0679<\/p>\n<\/li>\n<li>\n<p>\u0627\u067e\u0646\u06d2 \u0627\u06cc \u0645\u06cc\u0644 \u0641\u0631\u0627\u06c1\u0645 \u06a9\u0646\u0646\u062f\u06c1 \u06a9\u0648 \u06a9\u0627\u0644 \u06a9\u0631\u06cc\u06ba\u06d4<\/p>\n<\/li>\n<li>\n<p>\u0646\u0627\u06a9\u0627\u0645\u06cc \u067e\u0631 \u062f\u0648\u0628\u0627\u0631\u06c1 \u06a9\u0648\u0634\u0634 \u06a9\u0631\u06cc\u06ba\u06d4<\/p>\n<\/li>\n<li>\n<p>\u0646\u062a\u0627\u0626\u062c \u0631\u06cc\u06a9\u0627\u0631\u0688 \u06a9\u0631\u06cc\u06ba<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"language-text\">Good path (asynchronous):\n\nClient \u2500\u2500&#x25b6; API \u2500\u2500&#x25b6; Database \u2500\u2500&#x25b6; Queue \u2500\u2500&#x25b6; Client (fast response)\n                                   \u2502\n                                   \u25bc\n                                Worker \u2500\u2500&#x25b6; Email provider\n<\/code><\/pre>\n<p>\u06cc\u06c1 \u0648\u06c1\u06cc \u062e\u06cc\u0627\u0644 \u06c1\u06d2 \u062c\u06cc\u0633\u06d2 \u0627\u067e \u0644\u0648\u0688\u0632 \u067e\u0631 \u06a9\u0627\u0631\u0631\u0648\u0627\u0626\u06cc \u06a9\u0631\u0646\u0627\u060c \u067e\u06cc \u0688\u06cc \u0627\u06cc\u0641 \u0628\u0646\u0627\u0646\u0627\u060c AI APIs \u06a9\u0648 \u06a9\u0627\u0644 \u06a9\u0631\u0646\u0627\u060c \u06cc\u0627 \u0688\u06cc\u0679\u0627 \u06a9\u0648 \u0622\u067e \u06a9\u06d2 CRM \u0633\u06d2 \u06c1\u0645 \u0622\u06c1\u0646\u06af \u06a9\u0631\u0646\u0627\u06d4 \u0627\u06cc \u0645\u06cc\u0644 \u0635\u0631\u0641 \u0633\u0628 \u0633\u06d2 \u0639\u0627\u0645 \u0645\u062b\u0627\u0644 \u06c1\u06d2\u06d4<\/p>\n<h2 id=\"heading-5-how-to-move-email-to-a-background-queue\">5. \u0627\u06cc \u0645\u06cc\u0644\u0632 \u06a9\u0648 \u067e\u0633 \u0645\u0646\u0638\u0631 \u06a9\u06cc \u0642\u0637\u0627\u0631 \u0645\u06cc\u06ba \u06a9\u06cc\u0633\u06d2 \u0645\u0646\u062a\u0642\u0644 \u06a9\u06cc\u0627 \u062c\u0627\u0626\u06d2\u06d4<\/h2>\n<p>BullMQ \u0627\u0648\u0631 Redis \u06a9\u0627 \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631\u062a\u06d2 \u06c1\u0648\u0626\u06d2 \u06a9\u0645 \u0633\u06d2 \u06a9\u0645 Node.js \u06a9\u06cc\u0633\u0627 \u0644\u06af\u062a\u0627 \u06c1\u06d2: \u0639\u06cc\u0646 \u0644\u0627\u0626\u0628\u0631\u06cc\u0631\u06cc \u0627\u0633 \u06a9\u06cc \u062d\u062f\u0648\u062f \u0633\u06d2 \u06a9\u0645 \u0627\u06c1\u0645 \u06c1\u06d2\u06d4<\/p>\n<h3 id=\"heading-define-the-job\">\u0645\u0644\u0627\u0632\u0645\u062a \u06a9\u06cc \u062a\u0639\u0631\u06cc\u0641<\/h3>\n<pre><code class=\"language-typescript\">\/\/ jobs\/email.ts\nexport type SendEmailJob = {\n  to: string;\n  template: 'confirm-account' | 'password-reset' | 'welcome';\n  variables: Record<string string=\"\">;\n  idempotencyKey: string;\n};\n<\/string><\/code><\/pre>\n<h3 id=\"heading-enqueue-from-the-api\">API \u0633\u06d2 \u0642\u0637\u0627\u0631 \u0645\u06cc\u06ba \u0634\u0627\u0645\u0644 \u06a9\u0631\u06cc\u06ba\u06d4<\/h3>\n<pre><code class=\"language-typescript\">import { emailQueue } from '..\/queues\/email-queue';\n\napp.post('\/signup', async (c) => {\n  const body = await c.req.json();\n\n  const user = await db.users.create({\n    email: body.email,\n    passwordHash: await hash(body.password),\n  });\n\n  await emailQueue.add(\n    'send-email',\n    {\n      to: user.email,\n      template: 'confirm-account',\n      variables: {\n        name: user.name,\n        confirmUrl: `https:\/\/example.com\/confirm\/${user.confirmToken}`,\n      },\n      idempotencyKey: `confirm-account:${user.id}`,\n    },\n    {\n      jobId: `confirm-account:${user.id}`,\n      attempts: 5,\n      backoff: { type: 'exponential', delay: 2000 },\n      removeOnComplete: 1000,\n      removeOnFail: 5000,\n    },\n  );\n\n  return c.json({ id: user.id }, 201);\n});\n<\/code><\/pre>\n<p>\u063a\u0648\u0631 \u06a9\u0631\u06cc\u06ba \u06a9\u06c1 \u06a9\u06cc\u0627 \u0628\u062f\u0644\u0627 \u06c1\u06d2\u06d4 API \u0627\u0628 \u0628\u06be\u06cc \u0635\u0627\u0631\u0641\u06cc\u0646 \u062a\u062e\u0644\u06cc\u0642 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4 SMTP \u06a9\u0627 \u0645\u0632\u06cc\u062f \u0627\u0646\u062a\u0638\u0627\u0631 \u0646\u06c1\u06cc\u06ba \u06a9\u0631\u0646\u0627\u06d4 Redis \u06a9\u06d2 \u0622\u067e\u0631\u06cc\u0634\u0646 \u06a9\u0648 \u0642\u0628\u0648\u0644 \u06a9\u0631\u0646\u06d2 \u06a9\u0627 \u0627\u0646\u062a\u0638\u0627\u0631 \u06a9\u0631\u06cc\u06ba\u06d4 \u06cc\u06c1 \u0639\u0627\u0645 \u0637\u0648\u0631 \u067e\u0631 \u0622\u067e \u06a9\u06d2 \u0627\u06cc \u0645\u06cc\u0644 \u0641\u0631\u0627\u06c1\u0645 \u06a9\u0646\u0646\u062f\u06c1 \u06a9\u0627 \u0627\u0646\u062a\u0638\u0627\u0631 \u06a9\u0631\u0646\u06d2 \u0633\u06d2 \u06a9\u06c1\u06cc\u06ba \u0632\u06cc\u0627\u062f\u06c1 \u0633\u0633\u062a\u0627 \u0627\u0648\u0631 \u0632\u06cc\u0627\u062f\u06c1 \u0645\u062a\u0648\u0642\u0639 \u06c1\u0648\u062a\u0627 \u06c1\u06d2\u06d4<\/p>\n<h3 id=\"heading-process-the-job-in-a-worker\">\u06a9\u0627\u0631\u06a9\u0646\u0648\u06ba \u0645\u06cc\u06ba \u067e\u0631\u0648\u0633\u06cc\u0633\u0646\u06af \u06a9\u0627\u0645<\/h3>\n<pre><code class=\"language-typescript\">\/\/ worker\/email-worker.ts\nimport { Worker } from 'bullmq';\nimport { emailClient } from '..\/lib\/email-client';\nimport { renderTemplate } from '..\/lib\/templates';\n\nnew Worker(\n  'email',\n  async (job) => {\n    const { to, template, variables } = job.data;\n\n    await emailClient.send({\n      to,\n      subject: subjectFor(template),\n      html: renderTemplate(template, variables),\n    });\n  },\n  {\n    connection: redisConnection,\n    concurrency: 5,\n  },\n);\n<\/code><\/pre>\n<p>\u06a9\u0627\u0631\u06a9\u0646 \u06a9\u0648 API \u0633\u06d2 \u0627\u0644\u06af \u0639\u0645\u0644 \u06a9\u06d2 \u0637\u0648\u0631 \u067e\u0631 \u0686\u0644\u0627\u0626\u06cc\u06ba\u06d4 \u0627\u0633 \u06a9\u06cc \u0648\u062c\u06c1 \u0633\u06d2 \u0627\u06cc \u0645\u06cc\u0644 \u06a9\u06cc \u0628\u0646\u062f\u0634 \u06a9\u0627\u0631\u06a9\u0646\u0648\u06ba \u06a9\u0648 \u0633\u0633\u062a \u06a9\u0631\u06d2 \u06af\u06cc\u060c \u0644\u06cc\u06a9\u0646 \u062a\u0645\u0627\u0645 HTTP \u062c\u0648\u0627\u0628\u0627\u062a \u0646\u06c1\u06cc\u06ba\u06d4<\/p>\n<h3 id=\"heading-return-the-right-status\">\u0635\u062d\u06cc\u062d \u062d\u06cc\u062b\u06cc\u062a \u0648\u0627\u067e\u0633 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u06d4<\/h3>\n<p>\u0633\u0627\u0626\u0646 \u0627\u067e \u06a9\u0631\u0646\u06d2 \u06a9\u06d2 \u0644\u06cc\u06d2\u060c <code>201 Created<\/code> \u06cc\u06c1 \u062a\u0628 \u062a\u06a9 \u062f\u0631\u0633\u062a \u06c1\u06d2 \u062c\u0628 \u062a\u06a9 \u06a9\u06c1 \u0622\u067e \u06a9\u0627 \u0627\u06a9\u0627\u0624\u0646\u0679 \u0645\u0648\u062c\u0648\u062f \u06c1\u06d2 \u0627\u0648\u0631 \u0622\u067e \u062a\u0635\u062f\u06cc\u0642\u06cc \u0627\u06cc \u0645\u06cc\u0644 \u06a9\u0627 \u0627\u0646\u062a\u0638\u0627\u0631 \u06a9\u0631 \u0631\u06c1\u06d2 \u06c1\u06cc\u06ba\u06d4<\/p>\n<p>\u0627\u062e\u062a\u062a\u0627\u0645\u06cc \u0646\u06a9\u0627\u062a \u06a9\u06d2 \u0644\u06cc\u06d2 \u062c\u0648 \u0635\u0631\u0641 \u06a9\u0627\u0631\u0631\u0648\u0627\u0626\u06cc\u0648\u06ba \u06a9\u0648 \u0645\u062a\u062d\u0631\u06a9 \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba\u060c \u06c1\u0645 \u062a\u0631\u062c\u06cc\u062d \u062f\u06cc\u062a\u06d2 \u06c1\u06cc\u06ba: <code>202 Accepted<\/code> \u062c\u0628 \u06a9\u0644\u0627\u0626\u0646\u0679 \u06a9\u0648 \u067e\u06cc\u0634\u0631\u0641\u062a \u06a9\u0648 \u0679\u0631\u06cc\u06a9 \u06a9\u0631\u0646\u06d2 \u06a9\u06cc \u0636\u0631\u0648\u0631\u062a \u06c1\u0648 \u062a\u0648 \u0679\u0627\u0633\u06a9 \u06cc\u0627 \u0688\u06cc\u0644\u06cc\u0648\u0631\u06cc ID \u0644\u0648\u0679\u0627\u062a\u0627 \u06c1\u06d2\u06d4<\/p>\n<h2 id=\"heading-6-how-to-handle-retries-failures-and-idempotency\">6. \u062f\u0648\u0628\u0627\u0631\u06c1 \u06a9\u0648\u0634\u0634\u0648\u06ba\u060c \u0646\u0627\u06a9\u0627\u0645\u06cc\u0648\u06ba\u060c \u0627\u0648\u0631 \u0628\u06d2 \u062d\u0633\u06cc \u06a9\u0648 \u06a9\u06cc\u0633\u06d2 \u06c1\u06cc\u0646\u0688\u0644 \u06a9\u06cc\u0627 \u062c\u0627\u0626\u06d2\u06d4<\/h2>\n<p>\u0635\u0631\u0641 \u0627\u06cc \u0645\u06cc\u0644\u0632 \u06a9\u0648 \u0642\u0637\u0627\u0631 \u0645\u06cc\u06ba \u0644\u06d2 \u062c\u0627\u0646\u0627 \u06a9\u0627\u0641\u06cc \u0646\u06c1\u06cc\u06ba \u06c1\u06d2\u06d4 \u06c1\u0645\u06cc\u06ba \u0646\u0627\u06a9\u0627\u0645\u06cc \u06a9\u06d2 \u0627\u0635\u0648\u0644 \u06a9\u06cc \u0628\u06be\u06cc \u0636\u0631\u0648\u0631\u062a \u06c1\u06d2\u06d4<\/p>\n<h3 id=\"heading-retry-transient-errors\">\u0639\u0627\u0631\u0636\u06cc \u063a\u0644\u0637\u06cc \u06a9\u06cc \u062f\u0648\u0628\u0627\u0631\u06c1 \u06a9\u0648\u0634\u0634 \u06a9\u0631\u06cc\u06ba\u06d4<\/h3>\n<p>\u0646\u06cc\u0679 \u0648\u0631\u06a9 \u06a9\u06cc \u062e\u0631\u0627\u0628\u06cc\u060c <code>429 Too Many Requests<\/code>\u0627\u0648\u0631 <code>503 Service Unavailable<\/code> \u0622\u067e \u06a9\u0648 \u0628\u06cc\u06a9 \u0622\u0641 \u06a9\u0631\u06a9\u06d2 \u062f\u0648\u0628\u0627\u0631\u06c1 \u06a9\u0648\u0634\u0634 \u06a9\u0631\u0646\u06d2 \u06a9\u06cc \u0636\u0631\u0648\u0631\u062a \u06c1\u0648\u06af\u06cc\u06d4 \u0645\u0633\u0644\u0633\u0644 \u063a\u0644\u0637\u06cc\u0627\u06ba\u060c \u062c\u06cc\u0633\u06d2 \u063a\u0644\u0637 \u0648\u0635\u0648\u0644 \u06a9\u0646\u0646\u062f\u06af\u0627\u0646\u060c \u062a\u06cc\u0632\u06cc \u0633\u06d2 \u0646\u0627\u06a9\u0627\u0645 \u06c1\u0648 \u062c\u0627\u0626\u06cc\u06ba \u06af\u06d2 \u0627\u0648\u0631 \u0688\u06cc\u0688 \u0644\u06cc\u0679\u0631 \u0642\u0637\u0627\u0631 \u06cc\u0627 \u0646\u0627\u06a9\u0627\u0645 \u0622\u067e\u0631\u06cc\u0634\u0646 \u0679\u06cc\u0628\u0644 \u0645\u06cc\u06ba \u062f\u06a9\u06be\u0627\u0626\u06cc \u062f\u06cc\u06ba \u06af\u06d2\u06d4<\/p>\n<h3 id=\"heading-make-jobs-idempotent\">\u06a9\u0627\u0645\u0648\u06ba \u06a9\u0648 \u0628\u06d2 \u0627\u062e\u062a\u06cc\u0627\u0631 \u0628\u0646\u0627\u0646\u0627<\/h3>\n<p>\u0627\u06cc\u06a9 \u06a9\u0627\u0631\u06a9\u0646 \u0627\u06cc\u06a9 \u0633\u06d2 \u0632\u06cc\u0627\u062f\u06c1 \u0628\u0627\u0631 \u062f\u0648\u0691 \u0633\u06a9\u062a\u0627 \u06c1\u06d2\u06d4 \u0645\u0633\u062a\u062d\u06a9\u0645 \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631\u06cc\u06ba\u06d4 <code>jobId<\/code> \u06cc\u0627 <code>idempotencyKey<\/code> \u0644\u06c1\u0630\u0627\u060c \u062f\u0648\u0628\u0627\u0631\u06c1 \u06a9\u0648\u0634\u0634 \u06a9\u0631\u0646\u06d2 \u06a9\u06d2 \u0646\u062a\u06cc\u062c\u06d2 \u0645\u06cc\u06ba \u0627\u06cc\u06a9 \u0631\u062c\u0633\u0679\u0631\u06cc\u0634\u0646 \u06a9\u06d2 \u0644\u06cc\u06d2 5 \u062e\u0648\u0634 \u0622\u0645\u062f\u06cc\u062f \u0627\u06cc \u0645\u06cc\u0644\u0632 \u0646\u06c1\u06cc\u06ba \u0628\u06be\u06cc\u062c\u06d2 \u062c\u0627\u0626\u06cc\u06ba \u06af\u06d2\u06d4<\/p>\n<p>\u0627\u06cc\u06a9 \u0639\u0645\u0644\u06cc \u0646\u0642\u0637\u06c1 \u0646\u0638\u0631:<\/p>\n<ul>\n<li>\n<p>\u06a9\u0627\u0631\u0648\u0628\u0627\u0631\u06cc \u0648\u0627\u0642\u0639\u0627\u062a \u0633\u06d2 \u0686\u0627\u0628\u06cc\u0627\u06ba \u062d\u0627\u0635\u0644 \u06a9\u0631\u06cc\u06ba\u06d4 <code>confirm-account:user_123<\/code><\/p>\n<\/li>\n<li>\n<p>\u0627\u06af\u0631 \u0645\u0646\u062a\u0642\u0644\u06cc \u06a9\u0627\u0645\u06cc\u0627\u0628 \u06c1\u0648 \u062c\u0627\u062a\u06cc \u06c1\u06d2\u060c \u062a\u0648 \u06c1\u0645 \u0641\u0631\u0627\u06c1\u0645 \u06a9\u0646\u0646\u062f\u06c1 \u06a9\u06d2 \u067e\u06cc\u063a\u0627\u0645 \u06a9\u06cc \u0634\u0646\u0627\u062e\u062a \u06a9\u0648 \u0645\u062d\u0641\u0648\u0638 \u06a9\u0631 \u0644\u06cc\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4<\/p>\n<\/li>\n<li>\n<p>\u0627\u06af\u0631 \u06a9\u0644\u06cc\u062f \u067e\u06c1\u0644\u06d2 \u0633\u06d2 \u06af\u0632\u0631 \u0686\u06a9\u06cc \u06c1\u06d2\u060c \u062a\u0648 \u0622\u067e\u0631\u06cc\u0634\u0646 \u06a9\u0648 \u0686\u06be\u0648\u0691 \u062f\u06cc\u0627 \u062c\u0627\u062a\u0627 \u06c1\u06d2\u06d4<\/p>\n<\/li>\n<\/ul>\n<h3 id=\"heading-dont-lose-the-business-event\">\u06a9\u0627\u0631\u0648\u0628\u0627\u0631\u06cc \u062a\u0642\u0631\u06cc\u0628 \u06a9\u0648 \u0645\u062a \u0686\u06be\u0648\u0691\u06cc\u06ba\u06d4<\/h3>\n<p>\u0627\u06af\u0631 \u06a9\u0648\u0626\u06cc \u0639\u0645\u0644 \u0622\u067e\u0633 \u0645\u06cc\u06ba \u0645\u062a\u0635\u0627\u062f\u0645 \u06c1\u0648\u06d4 <code>db.users.create()<\/code> \u0627\u0648\u0631 <code>emailQueue.add()<\/code>\u0622\u067e \u0627\u067e\u0646\u0627 \u0627\u06cc \u0645\u06cc\u0644 \u06a9\u06be\u0648 \u0633\u06a9\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4<\/p>\n<p>\u0627\u0633 \u062e\u0637\u0631\u06d2 \u06a9\u0648 \u06a9\u0645 \u06a9\u0631\u0646\u06d2 \u06a9\u06d2 \u062f\u0648 \u0639\u0645\u0648\u0645\u06cc \u0637\u0631\u06cc\u0642\u06d2 \u06c1\u06cc\u06ba:<\/p>\n<ol>\n<li>\n<p><strong>\u0622\u0624\u0679 \u0628\u0627\u06a9\u0633 \u067e\u06cc\u0679\u0631\u0646<\/strong>: \u0627\u06cc \u0645\u06cc\u0644 \u06a9\u0627 \u0627\u0631\u0627\u062f\u06c1 <code>outbox<\/code> \u0635\u0627\u0631\u0641 \u06a9\u06cc \u0642\u0637\u0627\u0631 \u06a9\u06cc \u0637\u0631\u062d \u0688\u06cc\u0679\u0627 \u0628\u06cc\u0633 \u06a9\u06d2 \u0644\u06cc\u0646 \u062f\u06cc\u0646 \u0645\u06cc\u06ba \u0627\u06cc\u06a9 \u0679\u06cc\u0628\u0644\u06d4 \u0639\u0644\u06cc\u062d\u062f\u06c1 \u067e\u0628\u0644\u0634\u0631\u0632 \u0633\u06d2 \u0645\u06cc\u0644 \u0628\u0627\u06a9\u0633 \u067e\u0691\u06be\u06cc\u06ba \u0627\u0648\u0631 \u0642\u0637\u0627\u0631 \u0645\u06cc\u06ba \u06a9\u0627\u0645 \u0634\u0627\u0645\u0644 \u06a9\u0631\u06cc\u06ba\u06d4<\/p>\n<\/li>\n<li>\n<p><strong>\u0627\u06af\u0631 \u062a\u0639\u0627\u0648\u0646 \u06cc\u0627\u0641\u062a\u06c1 \u06c1\u0648 \u062a\u0648 \u0644\u06cc\u0646 \u062f\u06cc\u0646 \u06a9\u06cc \u0642\u0637\u0627\u0631 \u0634\u0627\u0645\u0644 \u06a9\u0631\u06cc\u06ba\u06d4<\/strong>: \u0644\u06a9\u06be\u0646\u06d2 \u0627\u0648\u0631 \u0627\u0636\u0627\u0641\u06d2 \u06a9\u0648 \u062c\u062a\u0646\u0627 \u0645\u0645\u06a9\u0646 \u06c1\u0648 \u0627\u06cc\u06a9 \u062f\u0648\u0633\u0631\u06d2 \u06a9\u06d2 \u0642\u0631\u06cc\u0628 \u0631\u06a9\u06be\u06cc\u06ba\u060c \u0627\u0648\u0631 \u0686\u06be\u0648\u0679\u06cc \u06c1\u0648\u0626\u06cc \u0645\u0646\u062a\u0642\u0644\u06cc\u0648\u06ba \u06a9\u06d2 \u0644\u06cc\u06d2 \u0645\u0635\u0627\u0644\u062d\u062a\u06cc \u06a9\u0627\u0631\u0631\u0648\u0627\u0626\u06cc\u0627\u06ba \u0686\u0644\u0627\u0626\u06cc\u06ba\u06d4<\/p>\n<\/li>\n<\/ol>\n<p>\u0628\u06c1\u062a \u0633\u06cc \u0627\u06cc\u067e\u0633 \u06a9\u06d2 \u0644\u06cc\u06d2\u060c \u0634\u0631\u0648\u0639 \u06a9\u0631\u0646\u06d2 \u06a9\u06d2 \u0644\u06cc\u06d2 \u0633\u0627\u062f\u06c1 \u0642\u0637\u0627\u0631 \u0627\u0648\u0631 \u0646\u06af\u0631\u0627\u0646\u06cc \u06a9\u0627\u0641\u06cc \u06c1\u06d2\u06d4 \u0627\u06af\u0631 \u062f\u0641\u062a\u0631 \u0633\u06d2 \u0628\u0627\u06c1\u0631 \u0627\u06cc \u0645\u06cc\u0644 \u0627\u06cc\u06a9 \u062d\u0642\u06cc\u0642\u06cc \u0642\u0627\u0628\u0644 \u0627\u0639\u062a\u0645\u0627\u062f \u0636\u0631\u0648\u0631\u062a \u0628\u0646 \u062c\u0627\u062a\u06cc \u06c1\u06d2\u060c \u062a\u0648 \u0627\u06cc\u06a9 \u0622\u0624\u0679 \u0628\u0627\u06a9\u0633 \u0634\u0627\u0645\u0644 \u06a9\u0631\u06cc\u06ba\u06d4<\/p>\n<h3 id=\"heading-separate-urgent-mail-from-bulk-mail\">\u0641\u0648\u0631\u06cc \u0627\u0648\u0631 \u0628\u0644\u06a9 \u0627\u06cc \u0645\u06cc\u0644\u0632 \u06a9\u0648 \u0627\u0644\u06af \u06a9\u0631\u06cc\u06ba\u06d4<\/h3>\n<p>\u067e\u0627\u0633 \u0648\u0631\u0688 \u0631\u06cc \u0633\u06cc\u0679 \u0627\u0648\u0631 OTP \u0627\u06cc \u0645\u06cc\u0644\u0632 \u06a9\u0648 \u0646\u06cc\u0648\u0632 \u0644\u06cc\u0679\u0631 \u06a9\u06d2 \u062f\u06be\u0645\u0627\u06a9\u0648\u06ba \u06a9\u06d2 \u067e\u06cc\u0686\u06be\u06d2 \u0646\u06c1\u06cc\u06ba \u0686\u06be\u067e\u0627\u06cc\u0627 \u062c\u0627\u0646\u0627 \u0686\u0627\u06c1\u06cc\u06d2\u06d4<\/p>\n<p>\u062a\u0631\u062c\u06cc\u062d\u06cc \u06cc\u0627 \u0639\u0644\u06cc\u062d\u062f\u06c1 \u0642\u0637\u0627\u0631\u06cc\u06ba \u0627\u0633\u062a\u0639\u0645\u0627\u0644 \u06a9\u0631\u06cc\u06ba\u06d4<\/p>\n<ul>\n<li>\n<p>\u0627\u0639\u0644\u06cc \u062a\u0631\u062c\u06cc\u062d: OTP\u060c \u067e\u0627\u0633 \u0648\u0631\u0688 \u0631\u06cc \u0633\u06cc\u0679\u060c \u062a\u0635\u062f\u06cc\u0642<\/p>\n<\/li>\n<li>\n<p>\u0639\u0645\u0648\u0645\u06cc \u062a\u0631\u062c\u06cc\u062d: \u0631\u0633\u06cc\u062f\u06cc\u06ba\u060c \u0622\u0646 \u0628\u0648\u0631\u0688\u0646\u06af<\/p>\n<\/li>\n<li>\n<p>\u06a9\u0645 \u062a\u0631\u062c\u06cc\u062d: \u0688\u0627\u0626\u062c\u0633\u0679\u060c \u0645\u0627\u0631\u06a9\u06cc\u0679\u0646\u06af<\/p>\n<\/li>\n<\/ul>\n<p>\u06cc\u06c1 \u0635\u0627\u0631\u0641\u06cc\u0646 \u06a9\u0648 \u062a\u06cc\u0632 \u0631\u0641\u062a\u0627\u0631\u06cc \u0633\u06d2 \u0627\u06cc \u0645\u06cc\u0644\u0632 \u06a9\u0648 \u0631\u0648\u06a9\u062a\u0627 \u06c1\u06d2 \u06cc\u06c1\u0627\u06ba \u062a\u06a9 \u06a9\u06c1 \u06c1\u0627\u0626\u06cc \u0648\u0627\u0644\u06cc\u0648\u0645 \u0679\u0631\u06cc\u0641\u06a9 \u0627\u0633\u067e\u0627\u0626\u06a9\u0633 \u06a9\u06d2 \u062f\u0648\u0631\u0627\u0646 \u0628\u06be\u06cc\u06d4<\/p>\n<h2 id=\"heading-7-what-else-should-leave-the-request-path\">7. \u0627\u06cc\u06a9 \u0627\u0648\u0631 \u0686\u06cc\u0632 \u062c\u0633 \u06a9\u0648 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u06a9\u0627 \u0631\u0627\u0633\u062a\u06c1 \u0686\u06be\u0648\u0691\u0646\u06d2 \u06a9\u06cc \u0636\u0631\u0648\u0631\u062a \u06c1\u06d2\u06d4<\/h2>\n<p>\u0627\u06af\u0631 \u06a9\u0648\u0626\u06cc \u0622\u067e\u0631\u06cc\u0634\u0646 \u062a\u06be\u0631\u0688 \u067e\u0627\u0631\u0679\u06cc \u0646\u06cc\u0679 \u0648\u0631\u06a9 API \u06a9\u0648 \u06a9\u0627\u0644 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u060c \u062a\u0648 \u0627\u0633\u06d2 \u0686\u0646\u062f \u0633\u0648 \u0645\u0644\u06cc \u0633\u06cc\u06a9\u0646\u0688 \u0633\u06d2 \u0632\u06cc\u0627\u062f\u06c1 \u0648\u0642\u062a \u0644\u06af \u0633\u06a9\u062a\u0627 \u06c1\u06d2\u060c \u06cc\u0627 \u062f\u0648\u0628\u0627\u0631\u06c1 \u06a9\u0648\u0634\u0634 \u06a9\u06cc \u0636\u0631\u0648\u0631\u062a \u06c1\u06d2\u060c \u0627\u0633\u06d2 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u06a9\u06d2 \u0631\u0627\u0633\u062a\u06d2 \u0633\u06d2 \u062e\u0627\u0631\u062c \u06a9\u0631 \u062f\u06cc\u06ba\u06d4 \u06cc\u06c1 \u0627\u0633 \u0635\u0648\u0631\u062a \u0645\u06cc\u06ba \u0628\u06be\u06cc \u062f\u0631\u0633\u062a \u06c1\u06d2 \u0627\u06af\u0631 \u0622\u067e \u06a9\u0644\u06cc\u062f\u06cc \u06a9\u0627\u0631\u0648\u0628\u0627\u0631\u06cc \u06a9\u0627\u0631\u0631\u0648\u0627\u0626\u06cc\u0648\u06ba \u06a9\u0648 \u06a9\u0627\u0644\u0639\u062f\u0645 \u06a9\u06cc\u06d2 \u0628\u063a\u06cc\u0631 \u0646\u0627\u06a9\u0627\u0645 \u06c1\u0648 \u0633\u06a9\u062a\u06d2 \u06c1\u06cc\u06ba\u060c \u06cc\u0627 \u0627\u06af\u0631 \u0622\u067e \u0633\u06cc \u067e\u06cc \u06cc\u0648 \u0633\u06d2 \u0645\u062a\u0639\u0644\u0642 \u06a9\u0627\u0645 \u06a9\u0631 \u0631\u06c1\u06d2 \u06c1\u06cc\u06ba \u062c\u06cc\u0633\u06d2 \u06a9\u06c1 \u062a\u0635\u0648\u06cc\u0631 \u06cc\u0627 \u067e\u06cc \u0688\u06cc \u0627\u06cc\u0641 \u0628\u0646\u0627\u0646\u0627\u06d4<\/p>\n<p>\u0627\u0633 \u0642\u0633\u0645 \u06a9\u06d2 \u06a9\u0627\u0645 \u06a9\u06cc \u06a9\u0686\u06be \u0639\u0627\u0645 \u0645\u062b\u0627\u0644\u06cc\u06ba \u06cc\u06c1 \u06c1\u06cc\u06ba:<\/p>\n<p>APIs \u06a9\u0648 \u0627\u0631\u0627\u062f\u06d2 \u06a9\u0648 \u062d\u0644 \u06a9\u0631\u0646\u0627 \u0627\u0648\u0631 \u062d\u0627\u0644\u062a \u06a9\u0648 \u0628\u0631\u0642\u0631\u0627\u0631 \u0631\u06a9\u06be\u0646\u0627 \u0686\u0627\u06c1\u06cc\u06d2\u06d4 \u06a9\u0627\u0631\u06a9\u0646\u0648\u06ba \u06a9\u0648 \u0633\u0633\u062a \u062d\u0635\u06c1 \u06a9\u0631\u0646\u0627 \u067e\u0691\u062a\u0627 \u06c1\u06d2\u06d4<\/p>\n<h2 id=\"heading-8-a-practical-checklist\">8. \u0639\u0645\u0644\u06cc \u0686\u06cc\u06a9 \u0644\u0633\u0679<\/h2>\n<p>\u0627\u06cc \u0645\u06cc\u0644 \u0628\u06be\u06cc\u062c\u0646\u06d2 \u06a9\u06cc \u0635\u0644\u0627\u062d\u06cc\u062a \u0641\u0631\u0627\u06c1\u0645 \u06a9\u0631\u0646\u06d2 \u0633\u06d2 \u067e\u06c1\u0644\u06d2\u060c \u062f\u0631\u062c \u0630\u06cc\u0644 \u0633\u0648\u0627\u0644\u0627\u062a \u067e\u0648\u0686\u06be\u06cc\u06ba:<\/p>\n<ol>\n<li>\n<p>\u06a9\u06cc\u0627 \u0635\u0627\u0631\u0641 \u06a9\u0648 \u06a9\u0627\u0645\u06cc\u0627\u0628\u06cc \u062f\u06cc\u06a9\u06be\u0646\u06d2 \u0633\u06d2 \u067e\u06c1\u0644\u06d2 \u0627\u06cc \u0645\u06cc\u0644 \u06a9\u0648 \u0645\u06a9\u0645\u0644 \u06a9\u0631\u0646\u0627 \u06c1\u0648\u06af\u0627\u061f<\/p>\n<\/li>\n<li>\n<p>\u0627\u06af\u0631 \u0645\u06cc\u0631\u0627 \u0627\u06cc \u0645\u06cc\u0644 \u0641\u0631\u0627\u06c1\u0645 \u06a9\u0646\u0646\u062f\u06c1 \u0646\u06cc\u0686\u06d2 \u0686\u0644\u0627 \u062c\u0627\u062a\u0627 \u06c1\u06d2 \u062a\u0648 \u06a9\u06cc\u0627 \u0627\u0633 \u0627\u062e\u062a\u062a\u0627\u0645\u06cc \u0646\u0642\u0637\u06c1 \u0633\u06d2 \u0633\u0645\u062c\u06be\u0648\u062a\u06c1 \u06a9\u06cc\u0627 \u062c\u0627 \u0633\u06a9\u062a\u0627 \u06c1\u06d2\u061f<\/p>\n<\/li>\n<li>\n<p>\u0627\u06af\u0631 \u0688\u06cc\u0679\u0627 \u0628\u06cc\u0633 \u0644\u06a9\u06be\u0646\u06d2 \u06a9\u06d2 \u0628\u0639\u062f \u0679\u0631\u0627\u0646\u0633\u0641\u0631 \u0646\u0627\u06a9\u0627\u0645 \u06c1\u0648 \u062c\u0627\u0626\u06d2 \u062a\u0648 \u0645\u06cc\u06ba \u06a9\u06cc\u0633\u06d2 \u0628\u0627\u0632\u06cc\u0627\u0641\u062a \u06a9\u0631\u0648\u06ba\u061f<\/p>\n<\/li>\n<li>\n<p>\u0627\u06af\u0631 \u06a9\u0648\u0626\u06cc \u0679\u0627\u0633\u06a9 \u062f\u0648 \u0628\u0627\u0631 \u0686\u0644\u062a\u0627 \u06c1\u06d2 \u062a\u0648 \u06a9\u06cc\u0627 \u0635\u0627\u0631\u0641\u06cc\u0646 \u06a9\u0648 \u0688\u067e\u0644\u06cc\u06a9\u06cc\u0679 \u067e\u06cc\u063a\u0627\u0645\u0627\u062a \u0646\u0638\u0631 \u0622\u0626\u06cc\u06ba \u06af\u06d2\u061f<\/p>\n<\/li>\n<li>\n<p>\u06a9\u06cc\u0627 OTP \u0627\u0648\u0631 \u067e\u0627\u0633 \u0648\u0631\u0688 \u062f\u0648\u0628\u0627\u0631\u06c1 \u062a\u0631\u062a\u06cc\u0628 \u062f\u06cc\u0646\u06d2 \u0648\u0627\u0644\u06cc \u0627\u06cc \u0645\u06cc\u0644\u0632 \u0645\u06cc\u06ba \u0628\u0644\u06a9 \u0627\u06cc \u0645\u06cc\u0644\u0632 \u06a9\u06d2 \u0645\u0642\u0627\u0628\u0644\u06d2 \u062a\u06cc\u0632 \u0631\u0641\u062a\u0627\u0631 \u0631\u0627\u0633\u062a\u06c1 \u06c1\u06d2\u061f<\/p>\n<\/li>\n<li>\n<p>\u06a9\u06cc\u0627 \u0645\u06cc\u06ba \u0644\u0627\u06af\u0632\u060c \u0645\u06cc\u0679\u0631\u06a9\u0633 \u06cc\u0627 \u0688\u06cc\u0634 \u0628\u0648\u0631\u0688\u0632 \u0645\u06cc\u06ba \u0646\u0627\u06a9\u0627\u0645 \u06a9\u0627\u0645\u0648\u06ba \u06a9\u0648 \u062f\u06cc\u06a9\u06be \u0633\u06a9\u062a\u0627 \u06c1\u0648\u06ba\u061f<\/p>\n<\/li>\n<li>\n<p>\u0627\u06af\u0631 \u0642\u0637\u0627\u0631 \u06a9\u06cc \u06af\u06c1\u0631\u0627\u0626\u06cc \u06cc\u0627 \u0646\u0627\u06a9\u0627\u0645\u06cc \u06a9\u06cc \u0634\u0631\u062d \u0628\u0691\u06be \u062c\u0627\u062a\u06cc \u06c1\u06d2 \u062a\u0648 \u06a9\u06cc\u0627 \u0622\u067e \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0641\u0631\u0627\u06c1\u0645 \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba\u061f<\/p>\n<\/li>\n<\/ol>\n<p>\u0627\u06af\u0631 \u0622\u067e \u0627\u0646 \u0633\u0648\u0627\u0644\u0627\u062a \u06a9\u0627 \u062c\u0648\u0627\u0628 \u0646\u06c1\u06cc\u06ba \u062f\u06d2 \u0633\u06a9\u062a\u06d2 \u06c1\u06cc\u06ba\u060c \u062a\u0648 \u0622\u067e \u06a9\u0627 \u0688\u06cc\u0632\u0627\u0626\u0646 \u0627\u0628\u06be\u06cc \u062a\u06a9 \u067e\u06cc\u062f\u0627\u0648\u0627\u0631 \u06a9\u06d2 \u0644\u06cc\u06d2 \u062a\u06cc\u0627\u0631 \u0646\u06c1\u06cc\u06ba \u06c1\u06d2\u06d4<\/p>\n<h2 id=\"heading-conclusion\">\u0646\u062a\u06cc\u062c\u06c1<\/h2>\n<p>API \u06a9\u06cc \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u06a9\u06d2 \u0627\u0646\u062f\u0631 \u0627\u06cc \u0645\u06cc\u0644 \u0628\u06be\u06cc\u062c\u0646\u0627 \u0622\u067e \u06a9\u0648 \u0641\u0631\u06cc\u0642 \u062b\u0627\u0644\u062b \u06a9\u06d2 \u0646\u0638\u0627\u0645 \u0633\u06d2 \u062c\u0648\u0691\u062a\u0627 \u06c1\u06d2 \u062c\u0633 \u06a9\u06d2 \u062c\u0648\u0627\u0628\u06cc \u0627\u0648\u0642\u0627\u062a \u0627\u0648\u0631 \u063a\u0644\u0637\u06cc \u06a9\u06cc \u0634\u0631\u062d \u0622\u067e \u06a9\u06d2 \u0642\u0627\u0628\u0648 \u0633\u06d2 \u0628\u0627\u06c1\u0631 \u06c1\u06d2\u06d4 \u06cc\u06c1 \u0688\u06cc\u0645\u0648 \u0645\u06cc\u06ba \u0622\u0633\u0627\u0646 \u0644\u06af \u0633\u06a9\u062a\u0627 \u06c1\u06d2\u060c \u0644\u06cc\u06a9\u0646 \u067e\u06cc\u062f\u0627\u0648\u0627\u0631 \u0645\u06cc\u06ba \u06cc\u06c1 \u0645\u06c1\u0646\u06af\u0627 \u06c1\u06d2.<\/p>\n<p>\u0627\u06cc\u06a9 \u0628\u06c1\u062a\u0631 \u0688\u06cc\u0641\u0627\u0644\u0679 \u0622\u0633\u0627\u0646 \u06c1\u06d2:<\/p>\n<ul>\n<li>\n<p>\u06a9\u0627\u0631\u0648\u0628\u0627\u0631\u06cc \u062a\u0628\u062f\u06cc\u0644\u06cc\u0648\u06ba \u06a9\u0627 \u0627\u0631\u062a\u06a9\u0627\u0628<\/p>\n<\/li>\n<li>\n<p>\u0627\u06cc \u0645\u06cc\u0644 \u06a9\u0648 \u0642\u0637\u0627\u0631 \u0645\u06cc\u06ba \u0631\u06a9\u06be\u06cc\u06ba<\/p>\n<\/li>\n<li>\n<p>\u062c\u0644\u062f\u06cc \u0648\u0627\u067e\u0633 \u0622\u062c\u0627\u0624<\/p>\n<\/li>\n<li>\n<p>\u06a9\u0627\u0631\u06a9\u0646\u0648\u06ba \u06a9\u0648 \u0646\u0627\u06a9\u0627\u0645\u06cc\u0648\u06ba \u06a9\u0648 \u0628\u06be\u06cc\u062c\u0646\u06d2\u060c \u062f\u0648\u0628\u0627\u0631\u06c1 \u06a9\u0648\u0634\u0634 \u06a9\u0631\u0646\u06d2 \u0627\u0648\u0631 \u0631\u067e\u0648\u0631\u0679 \u06a9\u0631\u0646\u06d2 \u062f\u06cc\u06ba\u06d4<\/p>\n<\/li>\n<\/ul>\n<p>\u06cc\u06c1 \u0646\u0645\u0648\u0646\u06d2 \u0622\u067e \u06a9\u06d2 API \u06a9\u0648 \u062a\u06cc\u0632 \u062a\u0631\u060c \u0627\u06cc \u0645\u06cc\u0644 \u06a9\u06cc \u062a\u0631\u0633\u06cc\u0644 \u06a9\u0648 \u0632\u06cc\u0627\u062f\u06c1 \u0642\u0627\u0628\u0644 \u0627\u0639\u062a\u0645\u0627\u062f\u060c \u0627\u0648\u0631 \u0646\u0627\u06a9\u0627\u0645\u06cc \u06a9\u06d2 \u0637\u0631\u06cc\u0642\u0648\u06ba \u06a9\u0627 \u0627\u0646\u062f\u0627\u0632\u06c1 \u0644\u06af\u0627\u0646\u0627 \u0628\u06c1\u062a \u0622\u0633\u0627\u0646 \u0628\u0646\u0627\u062a\u06d2 \u06c1\u06cc\u06ba\u06d4<\/p>\n<p>\u062c\u0628 \u0622\u067e \u0627\u067e\u0646\u06d2 \u0627\u06cc \u0645\u06cc\u0644 \u067e\u0631 \u0633\u06cc\u06af\u0645\u0646\u0679\u06cc\u0634\u0646 \u06a9\u0631\u062a\u06d2 \u06c1\u06cc\u06ba\u060c \u062a\u0648 \u0622\u067e \u06a9\u0648 \u06c1\u0631 \u062c\u06af\u06c1 \u0627\u06cc\u06a9 \u062c\u06cc\u0633\u06cc \u062d\u062f\u0648\u062f \u0646\u0638\u0631 \u0622\u0646\u06d2 \u0644\u06af\u062a\u06cc \u06c1\u06cc\u06ba\u06d4 \u0627\u06af\u0631 \u0635\u0627\u0631\u0641 \u0627\u0646\u062a\u0638\u0627\u0631 \u0646\u06c1\u06cc\u06ba \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u060c \u062a\u0648 \u06cc\u06c1 \u062f\u0631\u062e\u0648\u0627\u0633\u062a \u06a9\u0627 \u062d\u0635\u06c1 \u0646\u06c1\u06cc\u06ba \u06c1\u06d2\u06d4<\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u062a\u0631\u0642\u06cc \u06a9\u06d2 \u0645\u0631\u062d\u0644\u06d2 \u067e\u0631\u060c \u0633\u0627\u0626\u0646 \u0627\u067e \u0627\u062e\u062a\u062a\u0627\u0645\u06cc \u0646\u0642\u0637\u06c1 \u0679\u06be\u06cc\u06a9 \u0646\u0638\u0631 \u0622\u062a\u0627 \u06c1\u06d2\u06d4 \u0635\u0627\u0631\u0641 \u0631\u062c\u0633\u0679\u0631 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u060c \u0642\u0637\u0627\u0631 \u06a9\u0648 \u0645\u062d\u0641\u0648\u0638 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u060c \u0627\u067e\u0646\u06d2 \u0627\u06cc \u0645\u06cc\u0644 \u0641\u0631\u0627\u06c1\u0645 \u06a9\u0646\u0646\u062f\u06c1 \u06a9\u0648 \u06a9\u0627\u0644 \u06a9\u0631\u062a\u0627 \u06c1\u06d2\u060c \u0627\u0648\u0631 \u0648\u0627\u067e\u0633 \u0622\u062a\u0627 \u06c1\u06d2\u06d4 201 Created. \u06c1\u0631 \u0627\u06cc\u06a9 \u06a9\u0648 \u062e\u0648\u0634 \u0622\u0645\u062f\u06cc\u062f \u0627\u06cc \u0645\u06cc\u0644 \u0645\u0648\u0635\u0648\u0644 \u06c1\u0648\u062a\u0627 \u06c1\u06d2\u06d4 \u0622\u067e \u0627\u0633\u06d2 \u0628\u06be\u06cc\u062c \u062f\u06cc\u06ba\u06d4 \u067e\u06be\u0631 \u067e\u0631\u0648\u0688\u06a9\u0634\u0646 \u0679\u0631\u06cc\u0641\u06a9 \u0622\u062a\u0627 \u06c1\u06d2\u06d4 [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-28685","post","type-post","status-publish","format-standard","hentry","category-blog"],"_links":{"self":[{"href":"https:\/\/umang.pk\/ur\/wp-json\/wp\/v2\/posts\/28685","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/umang.pk\/ur\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/umang.pk\/ur\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/umang.pk\/ur\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/umang.pk\/ur\/wp-json\/wp\/v2\/comments?post=28685"}],"version-history":[{"count":0,"href":"https:\/\/umang.pk\/ur\/wp-json\/wp\/v2\/posts\/28685\/revisions"}],"wp:attachment":[{"href":"https:\/\/umang.pk\/ur\/wp-json\/wp\/v2\/media?parent=28685"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/umang.pk\/ur\/wp-json\/wp\/v2\/categories?post=28685"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/umang.pk\/ur\/wp-json\/wp\/v2\/tags?post=28685"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}