Skip to content

Commit

Permalink
✨ Supporting new concurrency model (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
MadsBogeskov authored Feb 22, 2024
1 parent 679669f commit 9e8c64b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private func _\(functionName)(\(functionArguments)) async -> \(functionReturnTyp
body += "\n"

body += """
\(accessControl) func \(functionName)(\(functionArguments)\(functionArguments.isEmpty ? "" : ", ")completion: @escaping (\(functionReturnType)) -> Void = { _ in }) {
\(accessControl) func \(functionName)(\(functionArguments)\(functionArguments.isEmpty ? "" : ", ")completion: @Sendable @escaping (\(functionReturnType)) -> Void = { _ in }) {
_Concurrency.Task {
let result = await _\(functionName)(\(parameters.map { "\($0.name.variableNameFormatted): \($0.name.variableNameFormatted)" }.joined(separator: ", ")))
completion(result)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
let serviceError = """
<ACCESSCONTROL> enum ServiceError<ErrorType>: Error {
<ACCESSCONTROL> enum ServiceError<ErrorType: Sendable>: Error {
// The request failed, e.g. timeout
case requestFailed(error: Error)
// The backend returned an error, e.g. a 500 Internal Server Error, 403 Unauthorized
Expand Down

0 comments on commit 9e8c64b

Please sign in to comment.