Canceling Tokio Tasks is Easy #rustlang #coding #rustprogramming #tokio #async

preview_player
Показать описание
Stopping your tokio tasks like this might leave your program in a bad state.

Instead, try Tokio's cancellation tokens.

Now you can run a proper shutdown procedure before terminating the task.

Such as flushing data to a file or database, or sending a shutdown message on a connection.
Рекомендации по теме
Комментарии
Автор

Nice! I don't code or anything like it, but I think for rust devs this may be useful. keep up the good work.

XioJN
Автор

surrealdb internally use cancellation token!
thanks for the helpful shorts ❤

rux
Автор

I am C# developper that loves rust and cancelation token seems very familiar

bersissevimli
welcome to shbcf.ru