struct Client { var handler: @Sendable () async throws -> Void static let shared: Client = { let model = Model() return Self(handler: { try await trampoline(model: model) }) }() private actor Model { func handle() throws {} } } func trampoline(model: Model) async throws { try await model.handle() }
(edited)isolated model
にしたいけど、多分そうすると同じ問題が再発する