You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4.2 KiB

🏃 💽 - Uvicorn

👑 👜 👆 💪 🏃 FastAPI 🈸 🛰 💽 🎰 🔫 💽 📋 💖 Uvicorn.

📤 3️⃣ 👑 🎛:

  • Uvicorn: ↕ 🎭 🔫 💽.
  • Hypercorn: 🔫 💽 🔗 ⏮️ 🇺🇸🔍/2️⃣ & 🎻 👪 🎏 ⚒.
  • 👸: 🔫 💽 🏗 ✳ 📻.

💽 🎰 & 💽 📋

📤 🤪🔃 📛 ✔️ 🤯. 👶

🔤 "💽" 🛎 ⚙️ 🔗 👯‍♂️ 🛰/☁ 💻 (⚛ ⚖️ 🕹 🎰) & 📋 👈 🏃‍♂ 🔛 👈 🎰 ( Uvicorn).

✔️ 👈 🤯 🕐 👆 ✍ "💽" 🏢, 💪 🔗 1️⃣ 📚 2️⃣ 👜.

🕐 🔗 🛰 🎰, ️ ⚠ 🤙 💽, 🎰, 💾 (🕹 🎰), 🕸. 👈 🌐 🔗 🆎 🛰 🎰, 🛎 🏃‍♂ 💾, 🌐 👆 🏃 📋.

💽 📋

👆 💪 🔫 🔗 💽 ⏮️:

//// tab | Uvicorn

  • Uvicorn, 🌩- 🔫 💽, 🏗 🔛 uvloop & httptool.
$ pip install "uvicorn[standard]"

---> 100%

/// tip

standard, Uvicorn 🔜 & ⚙️ 👍 🔗.

👈 uvloop, ↕-🎭 💧-♻ asyncio, 👈 🚚 🦏 🛠️ 🎭 📈.

///

////

//// tab | Hypercorn

  • Hypercorn, 🔫 💽 🔗 ⏮️ 🇺🇸🔍/2️⃣.
$ pip install hypercorn

---> 100%

...⚖️ 🙆 🎏 🔫 💽.

////

🏃 💽 📋

👆 💪 ⤴️ 🏃 👆 🈸 🎏 🌌 👆 ✔️ 🔰, 🍵 --reload 🎛, :

//// tab | Uvicorn

$ uvicorn main:app --host 0.0.0.0 --port 80

<span style="color: green;">INFO</span>:     Uvicorn running on http://0.0.0.0:80 (Press CTRL+C to quit)

////

//// tab | Hypercorn

$ hypercorn main:app --bind 0.0.0.0:80

Running on 0.0.0.0:8080 over http (CTRL + C to quit)

////

/// warning

💭 --reload 🎛 🚥 👆 ⚙️ ️.

--reload 🎛 🍴 🌅 🌅 ℹ, 🌅 ⚠, ️.

️ ℹ 📚 ⏮️ 🛠️, 👆 🚫🔜 🚫 ⚙️ 🏭.

///

Hypercorn ⏮️ 🎻

💃 & FastAPI 🔛 AnyIO, 👫 🔗 ⏮️ 👯‍♂️ 🐍 🐩 🗃 & 🎻.

👐, Uvicorn 🕴 🔗 ⏮️ ✳, & ️ 🛎 ⚙️ uvloop, ↕-🎭 💧-♻ asyncio.

🚥 👆 💚 🔗 ⚙️ 🎻, ⤴️ 👆 💪 ⚙️ Hypercorn 🐕‍🦺 ️. 👶

Hypercorn ⏮️ 🎻

🥇 👆 💪 Hypercorn ⏮️ 🎻 🐕‍🦺:

$ pip install "hypercorn[trio]"
---> 100%

🏃 ⏮️ 🎻

⤴️ 👆 💪 🚶‍♀️ 📋 ⏸ 🎛 --worker-class ⏮️ 💲 trio:

$ hypercorn main:app --worker-class trio

& 👈 🔜 ▶️ Hypercorn ⏮️ 👆 📱 ⚙️ 🎻 👩‍💻.

🔜 👆 💪 ⚙️ 🎻 🔘 👆 📱. ⚖️ 👍, 👆 💪 ⚙️ AnyIO, 🚧 👆 📟 🔗 ⏮️ 👯‍♂️ 🎻 & ✳. 👶

🛠️ 🔧

👫 🖼 🏃 💽 📋 (📧.Ⓜ Uvicorn), ▶️ 👁 🛠️, 👂 🔛 🌐 📢 (0.0.0.0) 🔛 🔁 ⛴ ( 80).

👉 🔰 💭. 👆 🔜 🎲 💚 💅 🌖 👜, 💖:

  • 💂‍♂ - 🇺🇸🔍
  • 🏃‍♂ 🔛 🕴
  • 🧬 (🔢 🛠️ 🏃)
  • 💾
  • ⏮️ 🔁▶️

👤 🔜 💬 👆 🌅 🔃 🔠 👫 🔧, 💭 🔃 👫, & 🧱 🖼 ⏮️ 🎛 🍵 👫📃. 👶