Ahem, how do you know you converted sync to async properly?


Maybe a weird question, but I'm doing an exercise where the (non-async )code for a CLI is supplied and we have to convert it to async and use streams. The CLI is a simple program that retrieve stock quote based on what we give it from the command line.

I think I got the conversion to async right, but... I see no difference in the execution of the CLI(meaning I always get the price quote in the same order, and it takes about the same time as far as I can see), so how can I know if I didn't forget some synchronous code somewhere and that everything is async?

You can set up your application with tokio-console and check if any tasks are blocking the thread.

That said, if your application doesn't have a lot of stuff happening at the same time, async wont make much difference.


This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.