mirror of
https://github.com/element-hq/synapse.git
synced 2026-07-21 11:11:58 +00:00
Sync trait not needed on run_interaction
LLM summary: func only ever needs to be moved to a thread and called there sequentially, never shared by & across threads: - In the erasure, func is captured by-move into the Box<dyn Fn ... + Send> callback (only Send is required to box it that way). - The Python pool moves that callback into the runInteraction DB-thread closure and calls it there; the Rust pool calls it within a single async task. Neither sends &func to multiple threads concurrently.
This commit is contained in:
@@ -122,7 +122,6 @@ pub trait DatabasePoolExt: DatabasePool {
|
||||
R: Send + 'static,
|
||||
F: for<'txn> Fn(&'txn mut dyn Transaction) -> BoxFuture<'txn, anyhow::Result<R>>
|
||||
+ Send
|
||||
+ Sync
|
||||
+ 'static,
|
||||
{
|
||||
// Erase the concrete return type `R` into `Box<dyn Any>` so we can call
|
||||
|
||||
Reference in New Issue
Block a user