Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: alias actix-* features to their equivalent tokio-* features #1679

Merged
merged 2 commits into from
Aug 2, 2022
Merged

refactor: alias actix-* features to their equivalent tokio-* features #1679

merged 2 commits into from
Aug 2, 2022

Conversation

robjtede
Copy link
Contributor

@robjtede robjtede commented Feb 5, 2022

Actix Web v4 is stable and finally works under #[tokio::main] / #[tokio::test]. Therefore, I think it's safe to "remove" these feature flags now. They haven't actually been doing anything more than tokio- flags for a while.

I thought that removing the private flags and aliasing the public ones to their tokio- equivalent would be the best migration path. That way this could go out in a non-breaking release.

Inspired by #1669.

@robjtede robjtede marked this pull request as ready for review February 5, 2022 03:52
@robjtede
Copy link
Contributor Author

robjtede commented Feb 5, 2022

Test failures look similar to master's failures so doesn't appear like this broke anything.

@robjtede robjtede changed the title refactor: remove direct actix-rt support refactor: alias actix-* features to their equivalent tokio-* features Feb 5, 2022
@robjtede
Copy link
Contributor Author

robjtede commented Feb 5, 2022

It's also definitely possible to run fewer CI checks now, but I would leave that to a follow up PR, leaving this one to prove that they are equivalent.

@abonander
Copy link
Collaborator

The reason we've kept the runtime-actix-* features around is to try to limit confusion from newer users who may not know that Actix is based on Tokio or what that actually means in practice. They can just pick the runtime-actix-* feature without worrying.

Whether we keep the aliases or not going forward depends on how clear Actix-web wants to be about its interoperability with Tokio. While there's obviously no intent to hide Tokio, there's also nothing that, based on our experiences, states it clearly enough for a naive user to understand that Actix-web works on Tokio. For example:

The release-candidate docs still show using #[actix_web::main], which I still think would suggest to a naive user that Actix is a separate runtime from Tokio: https://docs.rs/actix-web/4.0.0-rc.2/actix_web/index.html

The README mentions "Full Tokio compatbility" but doesn't elaborate on what that means, and it's not mentioned at all in the otherwise identical list of features in the crate docs.

The docs for #[actix_web::main] don't explain that it uses a Tokio runtime.

The docs for actix_web::rt do mention Tokio in passing, but they don't explain why it's relevant.

I do agree, however, that it doesn't make sense to have a separate set of CI passes just for Actix, although I could also see a naive user complaining that Actix isn't covered in CI if we don't have them, so it still comes back around to Actix-web's messaging on the matter.

@robjtede
Copy link
Contributor Author

robjtede commented Feb 8, 2022

Appreciate the perspective on clarity wrt relationship with Tokio. I'll make some changes to the docs. No rush removing the actix-* flags or CI checks until you're happy.

@robjtede
Copy link
Contributor Author

robjtede commented Feb 26, 2022

Actix Web v4 is released and I think the messaging on the relationship with Tokio is a lot clearer in the docs now.

@robjtede
Copy link
Contributor Author

@abonander you or someone else on the team available for review?

@abonander abonander added this to the 0.6.0 milestone Apr 7, 2022
actix- runtime feature flags are now aliases for tokio- flags
@robjtede
Copy link
Contributor Author

Rebased. I still think it's a good idea to simplify these.

README.md Outdated Show resolved Hide resolved
@abonander abonander merged commit 7adbb7f into launchbadge:main Aug 2, 2022
@robjtede robjtede deleted the remove-actix-rt branch August 2, 2022 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants