I have a
T: Future which is not
Send, i.e. it’s tied to the thread that created it. It means that
poll on this
Future is allowed only on its original thread (and in my case that thread belongs to the event loop, so it’s out of my control).
I’d like futures in other threads to wait for this future.
I’ve tried a few approaches to this, but it all comes down to one of two situations:
All kinds of wrappers and combinators, like
BiLock<T>, depend on the original
T, so they either aren’t
Sendthemselves, or require
T: Send, so I can’t touch them from other threads.
If I try to use some other synchronization method that isn’t directly polling the original future, I end up with various deadlocks/never-ending waits. I assume that’s because the original future may be unable to make progress if it doesn’t get polled. I can’t poll it from another thread, so some calls to
pollend up doing no work.
Is there a way around it?