Просмотр исходного кода

@nonsendable Application Extension added

v2_uploadImages
Mike Carman 2 недель назад
Родитель
Сommit
ba30a29e65
3 измененных файлов: 19 добавлений и 0 удалений
  1. Двоичные данные
      .swiftpm/xcode/package.xcworkspace/xcuserdata/mcarman.xcuserdatad/UserInterfaceState.xcuserstate
  2. +2
    -0
      Sources/App/configure.swift
  3. +17
    -0
      Sources/App/entrypoint.swift

Двоичные данные
.swiftpm/xcode/package.xcworkspace/xcuserdata/mcarman.xcuserdatad/UserInterfaceState.xcuserstate Просмотреть файл


+ 2
- 0
Sources/App/configure.swift Просмотреть файл

@@ -61,3 +61,5 @@ public func configure(_ app: Application) async throws {
// register routes
try routes(app)
}



+ 17
- 0
Sources/App/entrypoint.swift Просмотреть файл

@@ -33,3 +33,20 @@ enum Entrypoint {
try await app.runFromAsyncMainEntrypoint()
}
}
extension Application {
static let entrypointQueue = DispatchQueue(label: "app.entrypoint")

func runAsync() async throws {
nonisolated(unsafe) let app = self
try await withCheckedThrowingContinuation { (continuation: CheckedContinuation<Void, Error>) in
Application.entrypointQueue.async {
do {
try app.run()
continuation.resume()
} catch {
continuation.resume(throwing: error)
}
}
}
}
}

Загрузка…
Отмена
Сохранить