I'm having a hard time to find a simple example of using async with tokio in #rustlang I want to make something that catches signals and end the process (without killing it)
-
-
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 https://discord.gg/tokio .
1 reply 0 proslijeđenih tweetova 2 korisnika označavaju da im se sviđa -
Odgovor korisniku/ci @carllerche
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
1 reply 1 proslijeđeni tweet 1 korisnik označava da mu se sviđa -
Odgovor korisnicima @CecileTonglet @carllerche
It finally works! This how you can wrap your async app so it catches INT and TERM signals and exit gracefullypic.twitter.com/EhDHNCsYYU
0 proslijeđenih tweetova 2 korisnika označavaju da im se sviđa
Odgovor korisnicima @CecileTonglet @carllerche
04:00 - 18. sij 2020.
0 replies
0 proslijeđenih tweetova
1 korisnik označava da mu se sviđa
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.
Rustacean