You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error: future cannot be shared between threads safely
--> src/main.rs:16:17
|
16 | lambda::run(handler(func)).await?;
| ^^^^^^^ future returned by `func` is not `Sync`
|
::: ~/.cargo/git/checkouts/aws-lambda-rust-runtime-7c865cce90132439/9bd45c1/lambda-http/src/lib.rs:109:19
|
109 | pub fn handler<H: Handler>(handler: H) -> Adapter<H> {
| ------- required by this bound in `handler`
|
= help: the trait `Sync` is not implemented for `dyn Future<Output = std::result::Result<ListTablesOutput, RusotoError<ListTablesError>>> + Send`
note: future is not `Sync` as it awaits another future which is not `Sync`
--> src/main.rs:23:18
|
23 | let output = client.list_tables(Default::default()).await?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ await occurs here on type `Pin<Box<dyn Future<Output = std::result::Result<ListTablesOutput, RusotoError<ListTablesError>>> + Send>>`, which is not `Sync`
The text was updated successfully, but these errors were encountered:
@vultix after looking at this more I think we were a bit aggressive adding the sync trait. Considering the amount of libraries that could not be used if we kept the sync trait, I've removed it. I ran this with the provided example. Let me know if this helps with your other lambdas.
Pull Request #284 Introduced the
Sync
requirement for all http lambdas.This broke any http lambdas using any of these libraries:
Reproduction
This is the error I get:
The text was updated successfully, but these errors were encountered: