Closed SetheenDev closed 2 years ago
Nice catch @SetheenDev ! crossbeam uses some sync. mechanisms to store the returned objects, that our design does not do. This causes a restriction on the output of the future being 'static
. We could try to implement the crossbeam-style mechanism too, but I don't know how big a change it is / how it might affect performance.
For now, you could use sync. mechanisms like oneshot
or mpsc
channels of the tokio or futures crates. It is a bit more verbose, but should get around the lifetime issues.
Thanks for responding @rmanoka. I didn't think about oneshot but that seems perfect! Thank you!
Hello! I'd like to use this library but cannot figure out how to return references. This is the equivalent using raw crossbeam:
playground example
Using the async version, "&groups does not live long enough":
Same with _scope_andcollect. I don't think this is a bug, I'm new to rust and could use a pointer if this is possible. Thanks!