Post #1839164
2026-04-07 07:56 UTC
Replies (2)
-
@rhysmorgan@mastodon.social 2026-04-07 08:41
@akbashev @mattiem MainActor-isolation doesn't help for tests, I think. It anything, it causes MainActor contention if all your tests are running in parallel, and trying to run on the MainActor. I think it's a bit like the “If everything has to be Sendable, nothing makes sense as Sendable and it should be the only option." – if everything has to be MainActor, then it should be the default you opt out from. (but pls no, that mode is fraught with problems)
-
@mattiem@mastodon.social 2026-04-07 09:43
@akbashev @rhysmorgan you are right that a type like this can used from any isolation, including none at all. But the compiler will prevent unsafe accesses. So if the serialization that MainActor provides is necessary anywhere, you’ll know because it will fail to build.