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

Context is no longer Send/Sync #687

Closed
CaptainMaso opened this issue Oct 26, 2021 · 1 comment
Closed

Context is no longer Send/Sync #687

CaptainMaso opened this issue Oct 26, 2021 · 1 comment
Labels

Comments

@CaptainMaso
Copy link

I have some code using Gotham that requires async handlers to be Send + Sync.

I am using Tera to template the data returned from asynchronously from a database into HTML, which I think is a fairly common use-case.

As tera::Context is no longer Send/Sync, using it across await boundaries within the asynchronous function handlers causes the whole future to be not Send/Sync, meaning it cannot be used in many asynchronous web servers (I have checked Gotham, Rocket and Axum all require their handlers to be Send at the very least).

I'm sure the behaviour can be worked around, but as this was not an issue with Tera in previous versions, updating to 1.13 would break many peoples code.

I have seen #681, but as this is an issue with the code, thought it would be worth mentioning for anyone searching for results about this problem.

@Keats
Copy link
Owner

Keats commented Oct 26, 2021

This was unintended and will be changed back for the next release

@Keats Keats added the bug label Oct 26, 2021
jbr added a commit to trillium-rs/trillium that referenced this issue Oct 28, 2021
@Keats Keats closed this as completed Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants