Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

Learning Rust Async | Not Live Stream ⏺️

Автор: Learning Rust

Загружено: 2025-04-03

Просмотров: 341

Описание:

Learning tokio async / join / join set

This a "mistakes and all" attempt at learning some new async stuff

"Async is great for AI/LLM projects because it handles many tasks at once without blocking. While waiting for a response (like from an API or database), async lets other tasks run. This makes chatbots, data pipelines, and AI services faster and more efficient."

"Asynchronous programs in Rust are based around lightweight, non-blocking units of execution called tasks. The tokio::task module provides important tools for working with tasks"

If you want the code, and the article :
🔗 https://redandgreen.co.uk/tokio-async...

async book
🔗 https://rust-lang.github.io/async-boo...

official tokio tutorial
🔗 https://tokio.rs/tokio/tutorial

tokio crate documentation + example
🔗 https://docs.rs/tokio/latest/tokio/#w...

#learningrust #AsyncRust

Tokio async in rust example

Tokio's multi-threaded runtime, tasks will be scheduled across multiple threads.

Tokio's work-stealing scheduler will distribute tasks among available threads to maximize efficiency.

Awaiting tasks:
------------------------

For awaiting multiple tasks in Tokio, the best approach depends on your specific needs:

~ Using join_all from the futures crate is generally the best option when you need to:

Wait for all tasks to complete before proceeding
Keep your code concise
Collect all results at once

~ The individual handle.await approach is better when you need to:

Process each task's result immediately as it completes
Handle errors individually with custom logic
Do something between each task completion

~ tokio::JoinSet is best when you have a dynamic set of tasks where you:

Need to add/remove tasks during execution
Want to process results in completion order (not spawn order)
Need to limit concurrency

For most simple cases where you spawn a known number of tasks and need to wait for all of them, join_all provides the cleanest and most efficient solution with the least boilerplate code.

Learning Rust Async | Not Live Stream ⏺️

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

Rust + SQLite:  Complete Tutorial (Schema, CRUD, JSON & Async)

Rust + SQLite: Complete Tutorial (Schema, CRUD, JSON & Async)

orphan rule | new type idiom | Rust Language

orphan rule | new type idiom | Rust Language

AppState | Actix-web | Not Live Stream | Rust Language

AppState | Actix-web | Not Live Stream | Rust Language

Haskell, python и прочие приблуды. Прохожу машину HaskHell на TryHackMe, уровень средний!

Haskell, python и прочие приблуды. Прохожу машину HaskHell на TryHackMe, уровень средний!

ESP32: распознавание речи нейросетью (TensorFlow Lite)

ESP32: распознавание речи нейросетью (TensorFlow Lite)

Catching up with async Rust

Catching up with async Rust

Я ненавижу длинные цепочки If-Elif: этот шаблон проектирования решил эту проблему раз и навсегда

Я ненавижу длинные цепочки If-Elif: этот шаблон проектирования решил эту проблему раз и навсегда

Use Language Models in Your Rust Application (Free, Open-Weight, Self-Hosted)

Use Language Models in Your Rust Application (Free, Open-Weight, Self-Hosted)

Краткий обзор новой версии n8n 2.0  🚀

Краткий обзор новой версии n8n 2.0 🚀

Чего ждать от рефлексии в C++26

Чего ждать от рефлексии в C++26

Why I Switched from Python to Rust for AI Deployment

Why I Switched from Python to Rust for AI Deployment

Implementing SSH app in Rust | Code Review [05]

Implementing SSH app in Rust | Code Review [05]

Should you learn Rust in 2025?

Should you learn Rust in 2025?

Rust + LLM: создавайте собственные инструменты ИИ с помощью вызова функций! 🦀🤖

Rust + LLM: создавайте собственные инструменты ИИ с помощью вызова функций! 🦀🤖

Немецкие Инженеры Испытали Захваченный «Шерман» — А Потом Признали, Что Никогда Не Создавали

Немецкие Инженеры Испытали Захваченный «Шерман» — А Потом Признали, Что Никогда Не Создавали

КАК НЕЛЬЗЯ ХРАНИТЬ ПАРОЛИ (и как нужно) за 11 минут

КАК НЕЛЬЗЯ ХРАНИТЬ ПАРОЛИ (и как нужно) за 11 минут

New Type Pattern | Rust Language

New Type Pattern | Rust Language

The Future of Rust Web Applications - Greg Johnston

The Future of Rust Web Applications - Greg Johnston

Крах доллара,

Крах доллара, "уснувший жандарм" и мировой кирдык.

Как научиться читать мысли по руке

Как научиться читать мысли по руке

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]