diff --git a/Package.resolved b/Package.resolved index 3fda9eb..dfd9047 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,8 +6,17 @@ "repositoryURL": "https://github.com/ReactiveCocoa/ReactiveSwift.git", "state": { "branch": null, - "revision": "4a8e1e4a683e96daf658f68132dae781738bc862", - "version": "6.6.0" + "revision": "c5eecb5374ac342e22d46abd333e4c8c698c93cc", + "version": "7.2.0" + } + }, + { + "package": "swift-algorithms", + "repositoryURL": "https://github.com/apple/swift-algorithms.git", + "state": { + "branch": null, + "revision": "87e50f483c54e6efd60e885f7f5aa946cee68023", + "version": "1.2.1" } }, { @@ -19,13 +28,49 @@ "version": "0.4.1" } }, + { + "package": "swift-atomics", + "repositoryURL": "https://github.com/apple/swift-atomics.git", + "state": { + "branch": null, + "revision": "cd142fd2f64be2100422d658e7411e39489da985", + "version": "1.2.0" + } + }, + { + "package": "swift-collections", + "repositoryURL": "https://github.com/apple/swift-collections.git", + "state": { + "branch": null, + "revision": "671108c96644956dddcd89dd59c203dcdb36cec7", + "version": "1.1.4" + } + }, + { + "package": "swift-http-structured-headers", + "repositoryURL": "https://github.com/apple/swift-http-structured-headers.git", + "state": { + "branch": null, + "revision": "8e769facea6b7d46ea60e5e93635a384fd573480", + "version": "1.2.1" + } + }, + { + "package": "swift-http-types", + "repositoryURL": "https://github.com/apple/swift-http-types.git", + "state": { + "branch": null, + "revision": "a0a57e949a8903563aba4615869310c0ebf14c03", + "version": "1.4.0" + } + }, { "package": "swift-nio", "repositoryURL": "https://github.com/apple/swift-nio", "state": { "branch": null, - "revision": "94f41c4121a82fae5c7b1cb03e630e9f9e5e20f1", - "version": "2.32.1" + "revision": "c51907a839e63ebf0ba2076bba73dd96436bd1b9", + "version": "2.81.0" } }, { @@ -33,8 +78,17 @@ "repositoryURL": "https://github.com/apple/swift-nio-extras", "state": { "branch": null, - "revision": "de1c80ad1fdff1ba772bcef6b392c3ef735f39a6", - "version": "1.8.0" + "revision": "00f3f72d2f9942d0e2dc96057ab50a37ced150d4", + "version": "1.25.0" + } + }, + { + "package": "swift-nio-http2", + "repositoryURL": "https://github.com/apple/swift-nio-http2.git", + "state": { + "branch": null, + "revision": "170f4ca06b6a9c57b811293cebcb96e81b661310", + "version": "1.35.0" } }, { @@ -42,8 +96,8 @@ "repositoryURL": "https://github.com/apple/swift-nio-ssl", "state": { "branch": null, - "revision": "07c160b8724ee53a4b776328122be6338ff12bf2", - "version": "2.11.0" + "revision": "0cc3528ff48129d64ab9cab0b1cd621634edfc6b", + "version": "2.29.3" } }, { @@ -51,8 +105,26 @@ "repositoryURL": "https://github.com/apple/swift-nio-transport-services", "state": { "branch": null, - "revision": "1d28d48e071727f4558a8a4bb1894472abc47a58", - "version": "1.9.2" + "revision": "3c394067c08d1225ba8442e9cffb520ded417b64", + "version": "1.23.1" + } + }, + { + "package": "swift-numerics", + "repositoryURL": "https://github.com/apple/swift-numerics.git", + "state": { + "branch": null, + "revision": "e0ec0f5f3af6f3e4d5e7a19d2af26b481acb6ba8", + "version": "1.0.3" + } + }, + { + "package": "swift-system", + "repositoryURL": "https://github.com/apple/swift-system.git", + "state": { + "branch": null, + "revision": "a34201439c74b53f0fd71ef11741af7e7caf01e1", + "version": "1.4.2" } } ] diff --git a/Package.swift b/Package.swift index 7da9bbb..95fe8c8 100644 --- a/Package.swift +++ b/Package.swift @@ -26,11 +26,11 @@ let package = Package( .executable(name: "vanilla-client-example", targets: ["VanillaClientExample"]), ], dependencies: [ - .package(url: "https://github.com/ReactiveCocoa/ReactiveSwift.git", from: "6.6.0"), - .package(url: "https://github.com/apple/swift-nio", from: "2.32.1"), - .package(url: "https://github.com/apple/swift-nio-extras", from: "1.8.0"), - .package(url: "https://github.com/apple/swift-nio-transport-services", from: "1.9.2"), - .package(url: "https://github.com/apple/swift-nio-ssl", from: "2.10.4"), + .package(url: "https://github.com/ReactiveCocoa/ReactiveSwift.git", from: "7.2.0"), + .package(url: "https://github.com/apple/swift-nio", from: "2.76.1"), + .package(url: "https://github.com/apple/swift-nio-extras", from: "1.24.1"), + .package(url: "https://github.com/apple/swift-nio-transport-services", from: "1.23.0"), + .package(url: "https://github.com/apple/swift-nio-ssl", from: "2.29.0"), .package(url: "https://github.com/apple/swift-argument-parser", from: "0.4.0"), ], targets: [ diff --git a/Sources/RSocketCore/Extensions/RequestExamples.swift b/Sources/RSocketCore/Extensions/RequestExamples.swift index 58017fe..442224c 100644 --- a/Sources/RSocketCore/Extensions/RequestExamples.swift +++ b/Sources/RSocketCore/Extensions/RequestExamples.swift @@ -15,8 +15,8 @@ */ /** - This file contains examples of the `Coder`, `Encoder` and `Decoder` API. - All those examples should eventually be moved to documentation and/or tests. + This file contains examples of the `Coder`, `Encoder` and `Decoder` API. + All those examples should eventually be moved to documentation and/or tests. For now they are here to make sure we do not accidentally break any public API during development. */ @@ -51,8 +51,8 @@ fileprivate enum Requests { .encodeStaticMetadata("metrics", using: RoutingEncoder()) .encodeData(using: JSONDataEncoder(type: Metrics.self)) } - /// Same as above but gives the call site the option to encode additional dynamic metadata - static let metrics3 = FireAndForget<([CompositeMetadata], Metrics)> { + /// Same as above but gives the call site the option to encode additional dynamic metadata + static let metrics3 = FireAndForget<((),Metrics)> { Encoder() .useCompositeMetadata() .encodeStaticMetadata("metrics", using: RoutingEncoder()) @@ -67,7 +67,6 @@ fileprivate enum Requests { static let priceRequest1 = RequestResponse { Encoder() .useCompositeMetadata() - .encodeStaticMetadata("price", using: RoutingEncoder()) .encodeStaticMetadata([.applicationJson], using: AcceptableDataMIMETypeEncoder()) .encodeData(using: JSONDataEncoder(type: Stock.self)) .mapData(Stock.init(isin:)) @@ -76,7 +75,7 @@ fileprivate enum Requests { .decodeData(using: JSONDataDecoder(type: Price.self)) .mapData(\.price) } - /// Same as above but we do no longer need to explicitly encode the Acceptable Data MIME Type. + /// Same as above but we do no longer need to explicitly encode the Acceptable Data MIME Type. /// This is because we use the `Coder` convenience API which is a thin wrapper around an `Encoder` and `Decoder`. /// `Coder.decodeData(decoder:)` takes multiple decoders and automatically encodes their MIME Type as Acceptable Data MIME Type Metadata. /// It also looks for Data MIME Type and the Connection MIME Type and choose the correct decoder during decoding. @@ -85,23 +84,21 @@ fileprivate enum Requests { .useCompositeMetadata() .encodeStaticMetadata("price", using: RoutingEncoder()) .encodeData(using: JSONDataEncoder(type: ISIN.self).map(ISIN.init(isin:))) - .decodeData { - JSONDataDecoder(type: Price.self).map(\.price) - } + .decodeData (using:JSONDataDecoder(type: Price.self).map(\.price)) } /// Same as above but this time the encoder also encodes the MIME Type of the data as Date MIME Type Metadata because we use the `encodeData(encoder:)` method which can take multiple encoders. The call side need to specify which encoding it wants to use. - static let priceRequest3 = RequestResponse<(MIMEType, String), Double> { + static let priceRequest3 = RequestResponse<(String), Double> { Coder() .useCompositeMetadata() .encodeStaticMetadata("price", using: RoutingEncoder()) - .encodeData { + .encodeData (using: JSONDataEncoder(type: ISIN.self).map(ISIN.init(isin:)) - } - .decodeData { + ) + .decodeData (using: JSONDataDecoder(type: Price.self) .map(\.price) - } + ) } /// Works with `RequestStream` and `RequestChannel` too static let priceStream1 = RequestStream {