Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
https://github.com/drogue-iot/drogue-device/blob/972e1806c25752d66f60b2a6755124ee8148f522/src/actor.rs#L411
There is another way, and that is to re-insert the context and reference each time you resume at the yield-point. I was looking at adding actor co-routines to Stakker, and this is what I wanted to do. However it is not possible to do this on top of the existing async/await implementation in Rust, even with unsafe code, because you need a lifetime that represents "until the next yield", which cannot be expressed in Rust right now. However the problem is acknowledged and the feature is planned as part of Rust generators -- although who knows when that will get done.