ソースを参照

preconcurrency

v2_uploadImages
Mike Carman 2週間前
親
コミット
7ebd78bbdc
4個のファイルの変更、7行の追加、19行の削除
  1. バイナリ
      .swiftpm/xcode/package.xcworkspace/xcuserdata/mcarman.xcuserdatad/UserInterfaceState.xcuserstate
  2. +1
    -1
      Package.swift
  3. +1
    -1
      Sources/App/configure.swift
  4. +5
    -17
      Sources/App/entrypoint.swift

バイナリ
.swiftpm/xcode/package.xcworkspace/xcuserdata/mcarman.xcuserdatad/UserInterfaceState.xcuserstate ファイルの表示


+ 1
- 1
Package.swift ファイルの表示

@@ -1,4 +1,4 @@
// swift-tools-version:6.3.1
// swift-tools-version:5.8
import PackageDescription import PackageDescription


let package = Package( let package = Package(


+ 1
- 1
Sources/App/configure.swift ファイルの表示

@@ -19,7 +19,7 @@ public func configure(_ app: Application) async throws {
switch app.environment { switch app.environment {
case .development: case .development:
envHost = "localhost" envHost = "localhost"
envPort = 5432
envPort = 5433
default: default:
envHost = "vapor.prelub.com" envHost = "vapor.prelub.com"
envPort = 5432 envPort = 5432


+ 5
- 17
Sources/App/entrypoint.swift ファイルの表示

@@ -1,7 +1,11 @@
import Vapor
@preconcurrency import Vapor
import Dispatch import Dispatch
import Logging import Logging


private struct UncheckedApplication: @unchecked Sendable {
let app: Application
}

/// This extension is temporary and can be removed once Vapor gets this support. /// This extension is temporary and can be removed once Vapor gets this support.
private extension Vapor.Application { private extension Vapor.Application {
static let baseExecutionQueue = DispatchQueue(label: "vapor.codes.entrypoint") static let baseExecutionQueue = DispatchQueue(label: "vapor.codes.entrypoint")
@@ -33,21 +37,5 @@ 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)
}
}
}
}
}



読み込み中…
キャンセル
保存