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

remove Send and Sync bounds from Rust SDK router #2198

Merged
merged 1 commit into from
Dec 21, 2023

Conversation

dicej
Copy link
Contributor

@dicej dicej commented Dec 21, 2023

These bounds were preventing users from calling async functions which use http::executor since it uses Rc<RefCell<_>> internally, which is neither Send nor Sync.

See https://discord.com/channels/926888690310053918/1187255600002891798 for details.

These bounds were preventing users from calling async functions which use
`http::executor` since it uses `Rc<RefCell<_>>` internally, which is neither
`Send` nor `Sync`.

Signed-off-by: Joel Dice <joel.dice@fermyon.com>
@dicej dicej requested review from rylev and fibonacci1729 December 21, 2023 15:43
@dicej dicej merged commit d723301 into spinframework:main Dec 21, 2023
11 checks passed
@dicej dicej deleted the router-no-send-sync branch December 21, 2023 16:28
@seungjin
Copy link

I still got the same error with

# spin --version
spin 2.2.0-pre0 (a1a82c9c 2023-12-22)

I build from source now. So my spin has this merge in.

@dicej
Copy link
Contributor Author

dicej commented Dec 22, 2023

@seungjin The version of Spin you use doesn't matter in this case -- it's the spin_sdk version that matters. Would you please double-check that you're using a version of spin_sdk that contains this fix?

@seungjin
Copy link

In my Cargo.toml

spin-sdk = { git = "https://github.com/fermyon/spin", branch = "main" }

Did cargo clean, spin build

@seungjin
Copy link

Did with (in my Cargo.toml)

spin-sdk = { git = "https://github.com/fermyon/spin", rev = "10ec302282896cdbc2860fc8beaebba7c01c72af" }

and compile was succeeded!!

@seungjin
Copy link

Isn't the code in the main branch??
Not working with branch = main but works with rev = "10ec30228...." ?

@dicej
Copy link
Contributor Author

dicej commented Dec 22, 2023

The main branch has it. You may need to run cargo update to force cargo to fetch the latest code and update your Cargo.lock file.

@seungjin
Copy link

Yep. Figured out it is lock file. Working back now.
Thanks for fixing this issue!!!

@seungjin
Copy link

seungjin commented Dec 22, 2023

Compile was succeed and I deployed and tested.
But I don't get actually outbound http request's response to print.

@seungjin
Copy link

Never mind.. Working.. had two spin running.. some indirection happened.

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.

3 participants