Matt Massicotte on Nostr: MainActor.run is almost *never* the right solution. You want to define your isolation ...
MainActor.run is almost *never* the right solution. You want to define your isolation statically on the type, via a global actor annotation.
Dynamic isolation is an escape hatch, and it should set off alarm bells every time.
Published at
2024-04-17 10:01:05Event JSON
{
"id": "9ef40e80f853b60b764c7617c7d7f16aadd0ceead5b1d30d38b035982f10c53c",
"pubkey": "326c9100a3d1f1ecd0d35bf9590b2633e6c22a25debb08aac79d5af903bd8672",
"created_at": 1713348065,
"kind": 1,
"tags": [
[
"proxy",
"https://mastodon.social/users/mattiem/statuses/112285978801305971",
"activitypub"
]
],
"content": "MainActor.run is almost *never* the right solution. You want to define your isolation statically on the type, via a global actor annotation.\n\nDynamic isolation is an escape hatch, and it should set off alarm bells every time.",
"sig": "9ae2fe3326389386797d8c484be0c45b41be5eb280a97e60fe6b53a8c1aa6d1fa1344be3ea34d351057ff302398c55dcb2d38855024857e213efc049a5ad2c03"
}