Post #2625601
2026-05-02 09:28 UTC
@mattiem@mastodon.social
1. Is there a way to have some glue code that would allow invoking an async method in a synchronous context and uses something like a queue or semaphore to warrant the next expressions are not executed (suspended) until the async work is done?
Replies (1)
-
@mattiem@mastodon.social 2026-05-02 09:41
@kasrababaei@mastodon.social very common to want this, but unfortunately no. There is no way to do this that is guaranteed not to deadlock. While not necessarily helpful for practical problems, the need for synchronous access can be a very useful design hint. Especially if actors are involved (and perhaps should not be)