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
#if os(Linux) | |
import Glibc | |
#else | |
import Darwin | |
#endif | |
public final class Future<Value> { | |
public typealias Handler = (Value) -> Void | |
public typealias Executor = (@escaping () -> Void) -> 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 Network | |
let host: NWEndpoint.Host = .init("httpbin.org") | |
let port: NWEndpoint.Port = .https | |
let tlsConfig: NWProtocolTLS.Options = .init() | |
let parameters: NWParameters = .init(tls: tlsConfig) | |
let connection: NWConnection = .init(host: host, port: port, using: parameters) | |
connection.stateUpdateHandler = { state in | |
print("State Update: \(state)") | |
} |
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
protocol Buildable { | |
init(dict: [AnyKeyPath: Any]) throws | |
} | |
struct BuilderError : Error { | |
let reason: String | |
} | |
struct SomeBuildable : Buildable { | |
let field1: String |
NewerOlder