29 ms·
So given this example where actor methods are magically syncronous within the actor and async outside of the actor, did Swift solve the whole red/blue functions
by blacktriangle 5y ago
So given this example where actor methods are magically syncronous within the actor and async outside of the actor, did Swift solve the whole red/blue functions pain? Or at least seriously alleviate it.
- AJRF 5y agoIt uses async/await so they are still coloured functions - which, while coloured, doesn’t make it more painful to call than Non-concurrent methods I guess
- jayd16 5y agoIt seems more like syntax sugar to easily await synchronous methods on the actor specific task scheduler with a lot of linting thrown in to help you get it right. In C# you might have to use the following and worry about the private member access yourself. await Task.Run(()=>SyncMethod())