Twitter | Pretraživanje | |
Cecile Tonglet 🦀 17. sij
I'm having a hard time to find a simple example of using async with tokio in I want to make something that catches signals and end the process (without killing it)
Reply Retweet Označi sa "sviđa mi se"
Carl DB 17. sij
Odgovor korisniku/ci @CecileTonglet
Best strategy right now is to use `futures::select!` with one branch being the work to do and the other being `signal::ctrl_c()` (or whatever signal). Feel free to ask Qs in .
Reply Retweet Označi sa "sviđa mi se"
Cecile Tonglet 🦀
I got really great help and I almost managed to do what I wanted! Thanks! I will share the solution as soon as I have something I'm 100% sure is working as intended
Reply Retweet Označi sa "sviđa mi se" More
Cecile Tonglet 🦀 18. sij
Odgovor korisniku/ci @carllerche
It finally works! This how you can wrap your async app so it catches INT and TERM signals and exit gracefully
Reply Retweet Označi sa "sviđa mi se"
Cecile Tonglet 🦀 18. sij
Odgovor korisniku/ci @carllerche @lucio_d_franco
Reply Retweet Označi sa "sviđa mi se"