rodrimati1992/abi_stable_crates

Stable ABI for std::task::Waker

Closed this issue · 4 comments

This would be really useful for implementing async primitives since they often hold wakers. Unsure if its actually possible though.

Hmm,well I think you should also ask someone who knows how futures work in detail about whether using futures across cdylibs can work.

Going from the public API alone:

RawWaker's vtable has regular Rust function pointers in it,which aren't ffi-safe,That basically requires wrapping the Waker on one side and rewrapping it on the other,which can happen an unbounded amount of times.

I am not going to work on this,but if you want to work on it feel free to do it,and ask questions on the gitter(now that I discovered that I blocked the gitter script I will see your messages).

Cool thx.

I'm closing this since as far as I know its not really usable.

For anyone who comes across this issue, this is possible and it's implemented by the https://crates.io/crates/async_ffi crate.