Sfoglia il codice sorgente

@nonsendable Application Extension added

v2_uploadImages
Mike Carman 2 settimane fa
parent
commit
ba30a29e65
3 ha cambiato i file con 19 aggiunte e 0 eliminazioni
  1. BIN
      .swiftpm/xcode/package.xcworkspace/xcuserdata/mcarman.xcuserdatad/UserInterfaceState.xcuserstate
  2. +2
    -0
      Sources/App/configure.swift
  3. +17
    -0
      Sources/App/entrypoint.swift

BIN
.swiftpm/xcode/package.xcworkspace/xcuserdata/mcarman.xcuserdatad/UserInterfaceState.xcuserstate Vedi File


+ 2
- 0
Sources/App/configure.swift Vedi File

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



+ 17
- 0
Sources/App/entrypoint.swift Vedi File

@@ -33,3 +33,20 @@ enum Entrypoint {
try await app.runFromAsyncMainEntrypoint() 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)
}
}
}
}
}

Caricamento…
Annulla
Salva