What is the best path to update actix from 0.7 to current?

I have a web app which I wrote back when actix-web was 0.7 a lot of things seems to be changed since now and then what is the best and least painfull way to upgrade actix? I could not find any how to upgrade guides on docs or their website.

You can keep most of the handler logic, but other than that it's pretty much a rewrite. You can just start from scratch and integrate the server again.

On the upside, await is much nicer to work with.

BTW: I've initially been using actix runtime to spawn async tasks, but that didn't mix with tokio, and I've been seeing deadlocks when the two runtimes end up waiting for each other. If you need to spawn blocking work, IMHO it's best to spawn it right away using tokio and leave actix runtime alone.

1 Like

I recently answered a similar question on reddit, so here's the text from that response.

You need to change blocking calls to their async alternatives. You will likely need different or updated versions of your database library. To get some intuition for what needs to be asyncified, think about how long time it takes for your async function to go from one .await to the next. If it isn't near-instant, you need to asyncify something.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.