File tree Expand file tree Collapse file tree 3 files changed +57
-0
lines changed
Plugins/TableProPluginKit Expand file tree Collapse file tree 3 files changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+ import Foundation
2+
3+ public func pluginDispatchAsync< T: Sendable > (
4+ on queue: DispatchQueue ,
5+ execute work: @escaping @Sendable ( ) throws -> T
6+ ) async throws -> T {
7+ try await withCheckedThrowingContinuation { continuation in
8+ queue. async {
9+ do {
10+ let result = try work ( )
11+ continuation. resume ( returning: result)
12+ } catch {
13+ continuation. resume ( throwing: error)
14+ }
15+ }
16+ }
17+ }
18+
19+ public func pluginDispatchAsync(
20+ on queue: DispatchQueue ,
21+ execute work: @escaping @Sendable ( ) throws -> Void
22+ ) async throws {
23+ try await withCheckedThrowingContinuation { ( continuation: CheckedContinuation < Void , Error > ) in
24+ queue. async {
25+ do {
26+ try work ( )
27+ continuation. resume ( )
28+ } catch {
29+ continuation. resume ( throwing: error)
30+ }
31+ }
32+ }
33+ }
Original file line number Diff line number Diff line change 1+ //
2+ // PluginDriverError.swift
3+ // TableProPluginKit
4+ //
5+
6+ import Foundation
7+
8+ public protocol PluginDriverError : LocalizedError , Sendable {
9+ var pluginErrorMessage : String { get }
10+ var pluginErrorCode : Int ? { get }
11+ var pluginSqlState : String ? { get }
12+ var pluginErrorDetail : String ? { get }
13+ }
14+
15+ public extension PluginDriverError {
16+ var pluginErrorCode : Int ? { nil }
17+ var pluginSqlState : String ? { nil }
18+ var pluginErrorDetail : String ? { nil }
19+ }
Original file line number Diff line number Diff line change 1+ import Foundation
2+
3+ public enum PluginRowLimits {
4+ public static let defaultMax = 100_000
5+ }
You can’t perform that action at this time.
0 commit comments