diff --git a/Package.resolved b/Package.resolved index 670e449..ec184aa 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "e67e7a21b222173d4b8958ed36f7e72d20ff9897c188997a55dc05412f8b0860", + "originHash" : "bc7e7da478a806e0f7cbe377f7686d6279b8f12a875ce24603298eac157fefe8", "pins" : [ { "identity" : "async-http-client", @@ -96,8 +96,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/orlandos-nl/MongoKitten.git", "state" : { - "revision" : "6654e801833d5dab3c04af065646ba727f9542e9", - "version" : "7.9.7" + "revision" : "d9a82f57e24018cfa47a4aa359b51e684040871a", + "version" : "7.9.8" } }, { @@ -190,6 +190,15 @@ "version" : "1.3.1" } }, + { + "identity" : "swift-jobs", + "kind" : "remoteSourceControl", + "location" : "https://github.com/hummingbird-project/swift-jobs.git", + "state" : { + "revision" : "6aeb0a179567b944ecf81e1bbfdd474c1ee171f1", + "version" : "1.0.0-beta.6" + } + }, { "identity" : "swift-log", "kind" : "remoteSourceControl", diff --git a/Package.swift b/Package.swift index ab0e3d9..a5bac76 100644 --- a/Package.swift +++ b/Package.swift @@ -14,6 +14,7 @@ let package = Package( .package(url: "https://github.com/hummingbird-project/hummingbird-auth.git", from: "2.0.2"), .package(url: "https://github.com/hummingbird-project/hummingbird-websocket.git", from: "2.0.0"), .package(url: "https://github.com/hummingbird-project/swift-mustache.git", from: "2.0.0-beta.3"), + .package(url: "https://github.com/hummingbird-project/swift-jobs.git", from: "1.0.0-beta.6"), .package(url: "https://github.com/swift-server/async-http-client.git", from: "1.21.1"), .package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.5.0"), .package(url: "https://github.com/apple/swift-nio.git", from: "2.65.0"), @@ -33,6 +34,7 @@ let package = Package( .product(name: "HummingbirdRouter", package: "hummingbird"), .product(name: "AsyncHTTPClient", package: "async-http-client"), .product(name: "ArgumentParser", package: "swift-argument-parser"), + .product(name: "Jobs", package: "swift-jobs"), .product(name: "NIOCore", package: "swift-nio"), .product(name: "NIOPosix", package: "swift-nio"), .product(name: "Logging", package: "swift-log"), diff --git a/Sources/Articles/Documentation.docc/2024/getting-started-with-mongokitten/getting-started-with-mongokitten.md b/Sources/Articles/Documentation.docc/2024/getting-started-with-mongokitten/getting-started-with-mongokitten.md index 7a2cad3..dcf88c8 100644 --- a/Sources/Articles/Documentation.docc/2024/getting-started-with-mongokitten/getting-started-with-mongokitten.md +++ b/Sources/Articles/Documentation.docc/2024/getting-started-with-mongokitten/getting-started-with-mongokitten.md @@ -46,9 +46,9 @@ Let's create our first connection: For our social network, we'll create a Post model using the ``Codable`` protocol: -@Snippet(path: "site/Snippets/mongokitten-models", slice: "models") +@Snippet(path: "site/Snippets/mongokitten-basics", slice: "models") -The ``ObjectId`` type is MongoDB's native unique identifier, similar to a ``UUID``. Every document in MongoDB has an `_id` field, which must be unique within a collection. +The ``ObjectId`` type is MongoDB's native unique identifier, similar to a ``UUID``. Every document in MongoDB has an `_id` field, which must be unique within a collection. ### Creating Posts diff --git a/Sources/Articles/Documentation.docc/2024/realtime-mongodb-updates-with-changestreams-and-websockets/realtime-mongodb-updates-with-changestreams-and-websockets.md b/Sources/Articles/Documentation.docc/2024/realtime-mongodb-updates-with-changestreams-and-websockets/realtime-mongodb-updates-with-changestreams-and-websockets.md index ca042ed..3e0a597 100644 --- a/Sources/Articles/Documentation.docc/2024/realtime-mongodb-updates-with-changestreams-and-websockets/realtime-mongodb-updates-with-changestreams-and-websockets.md +++ b/Sources/Articles/Documentation.docc/2024/realtime-mongodb-updates-with-changestreams-and-websockets/realtime-mongodb-updates-with-changestreams-and-websockets.md @@ -21,7 +21,7 @@ Make sure you have MongoDB running locally before starting. ## The Connection Manager -The ``ConnectionManager`` handles WebSocket connections and MongoDB change notifications: +The `ConnectionManager` handles WebSocket connections and MongoDB change notifications: @Snippet(path: "site/Snippets/realtime-mongodb-app", slice: "connection-manager") @@ -36,7 +36,7 @@ The use of `withRegisteredClient` ensures that the WebSocket connection is prope ### Watching for Changes -Now that the ``ConnectionManager`` is implemented, we can watch for changes in the MongoDB database. For this, we'll tie the ``ConnectionManager`` to the application lifecycle using the ``Service`` protocol. +Now that the `ConnectionManager` is implemented, we can watch for changes in the MongoDB database. For this, we'll tie the `ConnectionManager` to the application lifecycle using the ``Service`` protocol. @Snippet(path: "site/Snippets/realtime-mongodb-app", slice: "watch-changes") @@ -112,10 +112,10 @@ You've learned how to create a real-time feed of MongoDB changes using ChangeStr @Comment { Primary Keyword: mongodb changestream swift - Secondary Keywords: + Secondary Keywords: - swift websocket mongodb - real-time mongodb updates - mongodb swift streaming - swift websocket server - mongodb changestream tutorial -} \ No newline at end of file +} \ No newline at end of file diff --git a/Sources/Articles/Documentation.docc/2024/whats-new-in-hummingbird-2/whats-new-in-hummingbird-2.md b/Sources/Articles/Documentation.docc/2024/whats-new-in-hummingbird-2/whats-new-in-hummingbird-2.md index 113c95e..863e216 100644 --- a/Sources/Articles/Documentation.docc/2024/whats-new-in-hummingbird-2/whats-new-in-hummingbird-2.md +++ b/Sources/Articles/Documentation.docc/2024/whats-new-in-hummingbird-2/whats-new-in-hummingbird-2.md @@ -20,7 +20,7 @@ The [HummingbirdCore](https://github.com/hummingbird-project/hummingbird-core) r ## Jobs framework updates -The HummingbirdJobs framework can be used to push work onto a queue, so that is processed outside of a request. Job handlers were restructured to use ``TaskGroup`` and conform to the ``Service`` protocol from the Swift service lifecycle framework. A ``JobQueue`` can also define it's own ``JobID`` type, which helps when integrating with various database/driver implementations. +The HummingbirdJobs framework can be used to push work onto a queue, so that is processed outside of a request. Job handlers were restructured to use ``TaskGroup`` and conform to the ``Service`` protocol from the Swift service lifecycle framework. A ``JobQueue`` can also define it's own ``JobQueueDriver/JobID`` type, which helps when integrating with various database/driver implementations. ## Connection pools diff --git a/Sources/Articles/Documentation.docc/2024/working-with-udp-in-swiftnio/working-with-udp-in-swiftnio.md b/Sources/Articles/Documentation.docc/2024/working-with-udp-in-swiftnio/working-with-udp-in-swiftnio.md index f641594..6b99e30 100644 --- a/Sources/Articles/Documentation.docc/2024/working-with-udp-in-swiftnio/working-with-udp-in-swiftnio.md +++ b/Sources/Articles/Documentation.docc/2024/working-with-udp-in-swiftnio/working-with-udp-in-swiftnio.md @@ -21,7 +21,7 @@ In order to start accepting packets, bind a UDP socket to a port: 1. First, create a ``DatagramBootstrap`` to open a UDP socket. 2. Next, bind the socket to a port using the `bind` method. 3. Before completing the setup, transform the created ``Channel`` by wrapping it in a ``NIOAsyncChannel`` -4. Unlike TCP, a UDP server does not receive _connections_. It receives an ``AddressedEnvelope`` containing a ``ByteBuffer`` and the sender's ``SocketAddress``. +4. Unlike TCP, a UDP server does not receive _connections_. It receives an ``AddressedEnvelope`` containing a ``ByteBuffer`` and the sender's ``NIOCore/SocketAddress``. Now that you've bound the socket, you can start receiving packets.