Skip to content

Conversation

@Jaltaire
Copy link

I'm observing that this is causing problems using async-openai-wasm in Axum/Aide route handlers with async_openai_wasm::Client constructed inside a shared AppState:

error: implementation of `Send` is not general enough
  --> ...
   |
16 |             aide::axum::routing::post_with(POST::on_request, POST::on_docs),
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Send` is not general enough
   |
   = note: `Send` would have to be implemented for the type `&AppState<D>`
   = note: ...but `Send` is actually implemented for the type `&'0 AppState<D>`, for some specific lifetime `'0`

Reverting the change (not using async closures) precludes this issue.

This reverts commit eee955e.
@ifsheldon
Copy link
Owner

Hmmmm, interesting and weird. Can you open an issue and give me a reproducer? Any clue why this happens? I think these changes are only internal, never expect these to affect public APIs. I realize I didn't enable issues in my repo, sorry about that.

@ifsheldon
Copy link
Owner

Can you check if commit 1764a845e84e9685d64520b36b4b9d825be629a0 works? I've simplified the code a bit.

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