Closed manstie closed 2 months ago
Your issue is unrelated to this crate. You could have figured this out by removing all use of typetag from your program.
- let payload = serde_json::to_value(queueable)?;
+ drop(queueable);
+ let payload = serde_json::Value::Null;
(And removing typetag::serde
attributes.) The error is the same.
You are missing a Send
bound. Holding queueable
across an await
point requires it to be sendable across threads.
- let queueable: Box<dyn Queueable> = Box::new(example.clone());
+ let queueable: Box<dyn Queueable + Send> = Box::new(example.clone());
I'm not sure if this belongs here but I have to start somewhere. I've never encountered an issue like this before in rust, but it seems I can work around it by not using this crate.
I have a minimal reproducible example here: https://github.com/manstie/axum-typetag
See the readme for error details.