select! macro don't seems to work with blocking tasks #5377
-
I'm working on a CLI tool and two crates helped me a lot to make it really interesting:
They both work perfectly separatly, but I'm trying to make them work together and it stopped working as I espected. Before my last change, I start a child process using a In my last change, I've added the possibility to listen users keyboard events thanks to rustyline with a custom struct. This also can listen for It works fine, but the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Unlike async tasks, blocking tasks cannot be canceled once started, and will always run to completion. |
Beta Was this translation helpful? Give feedback.
-
I have made some other tests and found out that the problem was only with The process tree look like this:
The |
Beta Was this translation helpful? Give feedback.
I have made some other tests and found out that the problem was only with
docker compose
command. I have better looked at the process list anddocker compose
runs a sub-processdocker-compose
.The process tree look like this:
The
select!
actually works fine, the problem comes from thedocker
command. It does not stop the sub-process when it's killed, so thedocker-compose logs -f
command remains as an orphan.