This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Atomics | |
| public final class Future<Value> { | |
| private let fulfillmentStatus: ManagedAtomic<Bool> | |
| private let valueStatus: ManagedAtomic<Bool> | |
| private let handlingStatus: ManagedAtomic<Bool> | |
| private let handlerStatus: ManagedAtomic<Bool> | |
| private let completionStatus: ManagedAtomic<Bool> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import struct Foundation.TimeInterval | |
| import struct Foundation.Date | |
| import class Atomics.ManagedAtomic | |
| /// Cancelation token that can be used to cancel associated tasks. | |
| public struct Cancelation { | |
| private var status: () -> Bool | |
| private var cancelation: () -> Void | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import struct Foundation.TimeInterval | |
| import struct Foundation.Date | |
| import class Atomics.ManagedAtomic | |
| /// Cancelation token that can be used to cancel associated tasks. | |
| public struct Cancelation { | |
| private var status: () -> Bool | |
| private var cancelation: () -> Void | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @dynamicMemberLookup | |
| public struct Identifier<RawValue: Hashable, Type>: Hashable, RawRepresentable { | |
| public var rawValue: RawValue | |
| public init(rawValue: RawValue) { | |
| self.rawValue = rawValue | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import class Foundation.NSRecursiveLock | |
| @dynamicMemberLookup @propertyWrapper | |
| public final class Synchronized<Value> { | |
| public var wrappedValue: Value { | |
| get { | |
| lock() | |
| defer { unlock() } | |
| return value |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func placeholder<R>(_ message: String = "Unimplemented") -> () -> R { | |
| { fatalError(message) } | |
| } | |
| func placeholder<A1, R>(_ message: String = "Unimplemented") -> (A1) -> R { | |
| { _ in fatalError(message) } | |
| } | |
| func placeholder<A1, A2, R>(_ message: String = "Unimplemented") -> (A1, A2) -> R { | |
| { _, _ in fatalError(message) } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/bash | |
| mkdir ./arm64 | |
| mkdir ./x86_64 | |
| find "./" -name '*.framework' -type d | while read -r FRAMEWORK | |
| do | |
| echo "Preparing framework: $FRAMEWORK" | |
| FRAMEWORK_EXECUTABLE_NAME=$(/usr/libexec/PlistBuddy -c "Print CFBundleExecutable" "$FRAMEWORK/Info.plist") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public struct Modifier<Subject, Failure: Error> { | |
| @usableFromInline internal let modifier: (Subject, ParameterStore) -> Result<Subject, Failure> | |
| } | |
| // MARK: - init | |
| public extension Modifier { | |
| init(_ modifier: @escaping (Subject, ParameterStore) -> Result<Subject, Failure>) { | |
| self.modifier = modifier | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import struct Dispatch.DispatchTime | |
| import protocol Dispatch.DispatchSourceTimer | |
| import class Dispatch.DispatchSource | |
| import class Dispatch.DispatchQueue | |
| import struct Foundation.NSDate.TimeInterval | |
| import class Foundation.NSLock.NSRecursiveLock | |
| public final class Throttle { | |
| public let queue: DispatchQueue |