struct Client { var handler: @Sendable () async throws -> Void static let shared: Client = { let model = Model() return Self(handler: { try await trampoline(model: model) }) }() actor Model { func handle() throws {} } } func trampoline(model: Client.Model) async throws { try await model.handle() }
trampoline
funcがあるのがちょっと