#92: nonisolated in Swift

Inside an actor, not every member necessarily needs actor isolation. If something does not read or write isolated state, it can be marked nonisolated.

actor Logger {
    nonisolated let subsystem = "app.logging"
}

This allows access without await because the member does not depend on protected actor state.

Used carefully, it makes actor APIs a bit clearer and easier to call.


I'm also on Twitter and GitHub.

Subscribe via RSS.